Hi,
I am trying to sort/group my excel worksheets based on a customized array.
I currently used this below VBA that I found on this site, but it didn't work. The range is in cells A206:A340 in a sheet named 'Cost Center Summary'
VBA used:
Sub SortWS2()
Dim SortOrder As Variant
Dim Ndx As Long
With Worksheets("Cost Center Summary").Range("A206:A340")
For Ndx = .Cells.Count To 1 Step -1
Worksheets(.Cells(Ndx).Value).Move before:=Worksheets(1)
Next Ndx
End With
End Sub
Please help as this VBA didn't work.
I am trying to sort/group my excel worksheets based on a customized array.
I currently used this below VBA that I found on this site, but it didn't work. The range is in cells A206:A340 in a sheet named 'Cost Center Summary'
VBA used:
Sub SortWS2()
Dim SortOrder As Variant
Dim Ndx As Long
With Worksheets("Cost Center Summary").Range("A206:A340")
For Ndx = .Cells.Count To 1 Step -1
Worksheets(.Cells(Ndx).Value).Move before:=Worksheets(1)
Next Ndx
End With
End Sub
Please help as this VBA didn't work.