View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default highest sheet name

highnum = 0
For Each sht In ThisWorkbook.Sheets
If Left(sht.Name, 4) = "acct" Then
newhighnum = Val(Mid(sht.Name, 5))
If newhighnum highnum Then
highnum = newhighnum
End If
End If
Next sht

"geebee" wrote:

hi,

lets say i have a number of sheets, with names like acct1, acct2, acct3,
acct4 and so forth. how can i determine the largest of the name? like from
the above, acct4 is the largest.

thanks in advance,
geebee