View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
GS GS is offline
external usenet poster
 
Posts: 364
Default Fastest way to select a sheet codename

You could give this a try if all your sheet codenames start with "Sheet"!

Sub ProcessSheets()
Dim i As Integer
Dim pWS As Worksheet
For i = 1 To ActiveWorkbook.Sheets.Count
Select Case CInt(Mid$(Sheets(i).CodeName, 6))
Case 1 To 25: Set pWS = Sheet51
Case Is 25: Set pWS = Sheet52
End Select
Next
End Sub

HTH
Kind regards,
Garry