ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   highest sheet name (https://www.excelbanter.com/excel-programming/406810-highest-sheet-name.html)

geebee

highest sheet name
 
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



joel

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




All times are GMT +1. The time now is 06:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com