Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.64 KB | None | 0 0
  1. Sub Button1_Click()
  2.    
  3.     range("C7").Select
  4.     Dim ind As Long
  5.     ind = 1
  6.    
  7.     Do Until IsEmpty(ActiveCell)
  8.        
  9.         Dim steps As Long
  10.         Dim till As Long
  11.         Dim starterValue As Long
  12.        
  13.         till = range("E" & ActiveCell.Row)
  14.         starterValue = ActiveCell.Value
  15.        
  16.         Do Until steps = till
  17.             Dim nnext As String
  18.             nnext = "G" & ind
  19.            
  20.             range(nnext).Value = starterValue + steps
  21.            
  22.             ind = ind + 1
  23.             steps = steps + 1
  24.         Loop
  25.         steps = 0
  26.         ActiveCell.Offset(1, 0).Select
  27.     Loop
  28. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement