Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. 1
  2. 501
  3. 1001
  4. 1501
  5. 2001
  6. 2
  7. 502
  8. 1002
  9. 1502
  10. 2002
  11.  
  12. Sub number()
  13. Dim i As Long, oCN As Long, oColumn As String
  14. oColumn = "A"
  15.  
  16. oCN = Columns(oColumn).Column
  17. For i = 1 To 500
  18. Range(oColumn & Cells(Rows.Count, oCN).End(xlUp).Offset(1, 0).Row).Value = i
  19. Range(oColumn & Cells(Rows.Count, oCN).End(xlUp).Offset(1, 0).Row).Value = i + 500
  20. Range(oColumn & Cells(Rows.Count, oCN).End(xlUp).Offset(1, 0).Row).Value = i + 1000
  21. Range(oColumn & Cells(Rows.Count, oCN).End(xlUp).Offset(1, 0).Row).Value = i + 1500
  22. Range(oColumn & Cells(Rows.Count, oCN).End(xlUp).Offset(1, 0).Row).Value = i + 2000
  23. Next i
  24. End Sub
  25.  
  26. =500*MOD(ROW()-1,5)+INT((ROW()-1)/5)+1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement