Guest User

Untitled

a guest
Jun 26th, 2015
14
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub DoWork()
  2.     Dim n As Long
  3.     n = 1&
  4.     Do While Sheet1.Cells(1, n + 1&).Value <> ""
  5.         n = n + 1&
  6.     Loop
  7.    
  8.     Dim row As Long, col As Long
  9.     For row = 1 To n
  10.         For col = 1 To n
  11.             Sheet2.Cells(row, col).Value = Sheet1.Cells(1, row).Value + Sheet1.Cells(2, col).Value
  12.         Next col
  13.     Next row
  14. End Sub
Advertisement
Add Comment
Please, Sign In to add comment