I have combined solutions from several posts to help write a macro to sort a variable number of sheets using a custom list created from a range entered on one master recap sheet. It's am very close but still have 2 issues I can't seem to get past.* Below my 2 questions I am copying the code I am using. Any help would be greatly appreciated!
1. * The code I found to allow for a variable number of tabs is skipping the last line of my range. I suspect that is because of the ".Offset(-1, 0)" portion of the code below, but when I take that out it hung up sooner.
2. * My tabs are named using an inventory code that may or may not contain alphanumeric characters. Except for the very last line, my macro is working up until it comes to the first sheet named using only numbers - no letters.* I don't know if I need the code to treat the number as text or a value or how to accomplish either.*
1. * The code I found to allow for a variable number of tabs is skipping the last line of my range. I suspect that is because of the ".Offset(-1, 0)" portion of the code below, but when I take that out it hung up sooner.
2. * My tabs are named using an inventory code that may or may not contain alphanumeric characters. Except for the very last line, my macro is working up until it comes to the first sheet named using only numbers - no letters.* I don't know if I need the code to treat the number as text or a value or how to accomplish either.*
Code:
Sub SortTab()
'
' SortTab Macro
' Sort tabs by recap order
Dim SortOrder As Variant
Dim Ndx As Long
With Sheets("LOV RECAP").Range(Range("E12"), Range("E12").End(xlDown).Offset(-1, 0))
*** For Ndx = .Cells.Count To 1 Step -1
******* Sheets(.Cells(Ndx).Value).Move Before:=Sheets(3)
*** Next Ndx
End With
End Sub