Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Guys
Could some one please advise the best way to cycle through all the sheets in a workbook whose sheet name length is 2. So any sheet name longer then 2 character should be ignored XL2002, VBA Thanks a lot in advance for your help - James |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
try something like sub foo() dim wks as worksheet for each wks in worksheets if wks.name<2 then ' do nothing else ' your code end if next end sub -- Regards Frank Kabel Frankfurt, Germany James wrote: Hi Guys Could some one please advise the best way to cycle through all the sheets in a workbook whose sheet name length is 2. So any sheet name longer then 2 character should be ignored XL2002, VBA Thanks a lot in advance for your help - James |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
for each sh in worksheets
if len(sh.Name) = 2 then ' work with the sheet end if Next -- Regards, Tom Ogilvy "James" wrote in message ... Hi Guys Could some one please advise the best way to cycle through all the sheets in a workbook whose sheet name length is 2. So any sheet name longer then 2 character should be ignored XL2002, VBA Thanks a lot in advance for your help - James |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you so much Frank
-----Original Message----- Hi try something like sub foo() dim wks as worksheet for each wks in worksheets if wks.name<2 then ' do nothing else ' your code end if next end sub -- Regards Frank Kabel Frankfurt, Germany James wrote: Hi Guys Could some one please advise the best way to cycle through all the sheets in a workbook whose sheet name length is 2. So any sheet name longer then 2 character should be ignored XL2002, VBA Thanks a lot in advance for your help - James . |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
make this sub foo() dim wks as worksheet for each wks in worksheets if len(wks.name)<2 then ' do nothing else ' your code end if next end sub -- Regards Frank Kabel Frankfurt, Germany Frank Kabel wrote: Hi try something like sub foo() dim wks as worksheet for each wks in worksheets if wks.name<2 then ' do nothing else ' your code end if next end sub James wrote: Hi Guys Could some one please advise the best way to cycle through all the sheets in a workbook whose sheet name length is 2. So any sheet name longer then 2 character should be ignored XL2002, VBA Thanks a lot in advance for your help - James |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dim sht as Worksheet
For Each sht in Worksheets If Len(sht.Name) = 2 Then sht.Select ' Put your code here. End if Next -----Original Message----- Hi Guys Could some one please advise the best way to cycle through all the sheets in a workbook whose sheet name length is 2. So any sheet name longer then 2 character should be ignored XL2002, VBA Thanks a lot in advance for your help - James . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Tab keeps cycling through the same row | Excel Discussion (Misc queries) | |||
Cycling through workbooks | Excel Discussion (Misc queries) | |||
Anyone out there knows of running cycling and swimming logs? | Excel Discussion (Misc queries) | |||
Cycling through worksheets | Excel Programming | |||
Need UDF help; cycling through various sheets using VBA name property | Excel Programming |