Do loop without do? Why?

  • Thread starter Thread starter John Wirt
  • Start date Start date
J

John Wirt

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
 
Hi John

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

Cheers
JulieD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top