Hi,
Im having trouble creating code to read off the name of my excel tabs. the names always start w/ 2 blank spaces and then they can be 2, 3, or 4 letters after it and then followed by a space. I need the code to discern if the name of the tab has a certain amount of letters to continue my code.
right now i have this and a few on error goto(s) to try to find it out such as tname = Mid(SheetName, 3, 3) or tname = Mid(SheetName, 3, 2)
SheetName = ActiveWorkbook.Worksheets(I).Name
tname = Mid(SheetName, 3, 4)
ActiveWorkbook.Worksheets(I).Activate
im sure there is a better way to do this probably with if statements or a switch. can anyone provide any suggestions?
Im having trouble creating code to read off the name of my excel tabs. the names always start w/ 2 blank spaces and then they can be 2, 3, or 4 letters after it and then followed by a space. I need the code to discern if the name of the tab has a certain amount of letters to continue my code.
right now i have this and a few on error goto(s) to try to find it out such as tname = Mid(SheetName, 3, 3) or tname = Mid(SheetName, 3, 2)
SheetName = ActiveWorkbook.Worksheets(I).Name
tname = Mid(SheetName, 3, 4)
ActiveWorkbook.Worksheets(I).Activate
im sure there is a better way to do this probably with if statements or a switch. can anyone provide any suggestions?