Advertisement
veronikaaa86

02. Print Numbers in Reverse Order

Sep 27th, 2022
1,293
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Sub PrintNumbersInReverseOrder()
  2.     Dim lastRow As Integer
  3.     lastRow = Cells(Rows.count, 1).End(xlUp).row
  4.    
  5.     ReDim numsArr(0 To lastRow - 1)
  6.     For r = 1 To lastRow
  7.         numsArr(r - 1) = Cells(r, 1)
  8.     Next
  9.    
  10.     For i = UBound(numsArr) To 0 Step -1
  11.         Debug.Print numsArr(i)
  12.     Next
  13. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement