Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Ignoring Sheet in For Each Loop

I have a loop which looks through each sheet in my
workbook and then looks through cells. I wanted to set it
up so that it ignores ones specific sheet called"Audit
Results".

For Each sh In .Worksheets
If LCase(sh.Name) < "Audit Results" Then
Code
Next

However it is not working. Can anyone tell me why?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Ignoring Sheet in For Each Loop

I mentioned to you before that this would not work. You are shifting the
case of the sh.Name down, but testing against proper case. Try

If LCase(sh.Name) < "audit results" Then

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ExcelMonkey" wrote in message
...
I have a loop which looks through each sheet in my
workbook and then looks through cells. I wanted to set it
up so that it ignores ones specific sheet called"Audit
Results".

For Each sh In .Worksheets
If LCase(sh.Name) < "Audit Results" Then
Code
Next

However it is not working. Can anyone tell me why?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default Ignoring Sheet in For Each Loop

ExcelMonkey

You are setting the sh.name to lower case and then comparing it to text
which is proper case, so the Audit Sheet will be audit sheet when tested
against Audit Sheet. If you want to leave LCase then change the test to
"audit sheet".

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"ExcelMonkey" wrote in message
...
I have a loop which looks through each sheet in my
workbook and then looks through cells. I wanted to set it
up so that it ignores ones specific sheet called"Audit
Results".

For Each sh In .Worksheets
If LCase(sh.Name) < "Audit Results" Then
Code
Next

However it is not working. Can anyone tell me why?

Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Ignoring Sheet in For Each Loop

Thankx. I remember you addressing it a previous post but
I missed your point. I get it now.

Thanks


-----Original Message-----
I mentioned to you before that this would not work. You

are shifting the
case of the sh.Name down, but testing against proper

case. Try

If LCase(sh.Name) < "audit results" Then

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ExcelMonkey" wrote

in message
...
I have a loop which looks through each sheet in my
workbook and then looks through cells. I wanted to set

it
up so that it ignores ones specific sheet called"Audit
Results".

For Each sh In .Worksheets
If LCase(sh.Name) < "Audit Results" Then
Code
Next

However it is not working. Can anyone tell me why?

Thanks



.

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
Loop through data for conditions and create a new sheet Mackay 1979 Excel Programming 3 September 6th 04 11:58 PM
Jump out of Do Loop on sheet change Paul Excel Programming 2 May 14th 04 04:21 PM
Loop - for each sheet not working? Shetty Excel Programming 6 January 15th 04 02:22 PM
Another loop & sheet question steve Excel Programming 4 November 25th 03 02:12 PM
Excluding sheet in loop david Excel Programming 2 July 31st 03 03:18 AM


All times are GMT +1. The time now is 12:28 AM.

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

About Us

"It's about Microsoft Excel"