Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Do loop without do? Why?

This procedure produces the error "Do loop without Do? How come?
- - - - -- - - - - - -
Public Sub HideSelectedSheetsOLD()
Dim Wsh As Worksheet
Dim Counter As Integer

For Each Wsh In ActiveWorkbook.Sheets
Counter = 7
Do
If UCase(Intersect(Wsh.Columns(Counter), Wsh.Rows(1))) = "HIDE"
Then
Wsh.Visible = xlSheetHidden
Counter = Counter + 1
Loop Until Counter = 26
Next

End Sub
- - - - - - - - - -
John Wirt


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Do loop without do? Why?

Hi John

as far as i can tell - you're missing an END IF in the DO LOOP which is
confusing things.

Cheers
JulieD

"John Wirt" wrote in message
...
This procedure produces the error "Do loop without Do? How come?
- - - - -- - - - - - -
Public Sub HideSelectedSheetsOLD()
Dim Wsh As Worksheet
Dim Counter As Integer

For Each Wsh In ActiveWorkbook.Sheets
Counter = 7
Do
If UCase(Intersect(Wsh.Columns(Counter), Wsh.Rows(1))) = "HIDE"
Then
Wsh.Visible = xlSheetHidden
Counter = Counter + 1
Loop Until Counter = 26
Next

End Sub
- - - - - - - - - -
John Wirt




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Do loop without do? Why?

Yes, Thanks. John

"JulieD" wrote in message
...



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 618
Default Do loop without do? Why?

you're welcome and thanks for the feedback

"John Wirt" wrote in message
...
Yes, Thanks. John

"JulieD" wrote in message
...





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
Find loop doesn't loop JSnow Excel Discussion (Misc queries) 2 June 24th 09 08:28 PM
How do I create a For loop within a For loop? Linking to specific cells in pivot table Excel Programming 2 January 24th 05 08:05 AM
For/Loop skipping one value in loop only Matt Jensen Excel Programming 6 January 8th 05 12:03 PM
Worksheet_Change - loop within a loop bgm Excel Programming 1 January 19th 04 01:27 PM
HELP!!!! Can't stop a loop (NOT an infinite loop) TBA[_2_] Excel Programming 3 December 14th 03 03:33 PM


All times are GMT +1. The time now is 10:03 PM.

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"