Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Cycling though all sheets in the workbook

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Cycling though all sheets in the workbook

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Cycling though all sheets in the workbook

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default Cycling though all sheets in the workbook

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Cycling though all sheets in the workbook

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default Cycling though all sheets in the workbook

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tab keeps cycling through the same row Mike Excel Discussion (Misc queries) 2 August 14th 08 12:20 AM
Cycling through workbooks Nico Excel Discussion (Misc queries) 4 July 4th 08 10:09 PM
Anyone out there knows of running cycling and swimming logs? Tlaloc Excel Discussion (Misc queries) 4 January 21st 05 04:29 AM
Cycling through worksheets Chris Gorham[_3_] Excel Programming 2 November 5th 03 08:37 PM
Need UDF help; cycling through various sheets using VBA name property Keith R[_3_] Excel Programming 3 July 23rd 03 02:06 PM


All times are GMT +1. The time now is 07:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"