i have this code and it's suppose to take the cities i listed in column 2 and move it to column 3 in reverse order.
so instead of it saying:
<tbody>
</tbody>
Option Explicit
Sub final()
Dim cities(10) As String
Dim i, N As Integer
N = Cells(1, 1)
For i = 1 To N
cities(i) = Cells(i, 2)
Next i
For i = N To 1 Step -1
Cells(i, 3) = cities(i)
Next i
End Sub
so instead of it saying:
Houston |
Galveston |
Beaumont |
Dallas |
El Paso |
San Antonio |
Midland |
Odessa |
Austin |
Ft. Worth its suppose to say: Ft. Worth Austin Odessa Midland San Antonio El Paso Dallas Beaumont Galveston Houston but for some reason the code does not work. I'm using Excel Visual Basics for Mac |
<tbody>
</tbody>
Option Explicit
Sub final()
Dim cities(10) As String
Dim i, N As Integer
N = Cells(1, 1)
For i = 1 To N
cities(i) = Cells(i, 2)
Next i
For i = N To 1 Step -1
Cells(i, 3) = cities(i)
Next i
End Sub