Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Do Until Loop Not Working

When I try to compile the code below, I get a 'Loop without Do' error. The
code is designed to loop through an array and hide the rows that have a zero
value.

Thoughts?
Using Excel 2003.


Sub HideRow()

Range("B15").Select

Do Until ActiveCell = "STOP"
If ActiveCell.Value = 0 Then
ActiveCell.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
Loop

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,624
Default Do Until Loop Not Working

In article ,
PJFry wrote:

When I try to compile the code below, I get a 'Loop without Do' error. The
code is designed to loop through an array and hide the rows that have a zero
value.

Thoughts?


You need an

End If

before the

Loop

statement.
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Do Until Loop Not Working

Sub HideRow()

Range("B15").Select

Do Until ActiveCell = "STOP"
If ActiveCell.Value = 0 Then
ActiveCell.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
End if
Loop

End Sub

--
Regards,
Tom Ogilvy


"PJFry" wrote:

When I try to compile the code below, I get a 'Loop without Do' error. The
code is designed to loop through an array and hide the rows that have a zero
value.

Thoughts?
Using Excel 2003.


Sub HideRow()

Range("B15").Select

Do Until ActiveCell = "STOP"
If ActiveCell.Value = 0 Then
ActiveCell.EntireRow.Hidden = True
ActiveCell.Offset(1, 0).Select
Else
ActiveCell.Offset(1, 0).Select
Loop

End Sub

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 143
Default Do Until Loop Not Working

Ah! Works perfectly. Thanks!

"JE McGimpsey" wrote:

In article ,
PJFry wrote:

When I try to compile the code below, I get a 'Loop without Do' error. The
code is designed to loop through an array and hide the rows that have a zero
value.

Thoughts?


You need an

End If

before the

Loop

statement.

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 Not Working Paul Black Excel Programming 7 August 29th 07 08:33 PM
Why is this loop not working? Mike R. Excel Programming 12 July 25th 07 02:26 PM
Do...Loop not working Sunny Lin Excel Programming 1 April 14th 05 01:19 AM
for next loop not working Tom Ogilvy Excel Programming 0 September 27th 04 05:36 PM
for next loop not working Ron Rosenfeld Excel Programming 0 September 25th 04 04:07 AM


All times are GMT +1. The time now is 05:55 PM.

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"