LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Problem with Do Loop and If

Can anyone help me please?

I am fairly new to writing code and am using a Do Loop combined with an If
to find out if there is an empty string or a formula in a cell and if there
is to clear the cell completely until the cell it reaches has nothing in it.
However, at first whilst looping through the second condition was ignored
(formula) and now I get an error message saying I have a Do without a
Loop!!!???? I'm going bananas. The code I have written looks like below.
If anyone can help I would be eternally grateful. Many thanks.

Do Until ActiveCell.Value < Empty

If ActiveCell.HasFormula = True Then
ActiveCell.Clear
ActiveCell.Offset(0, 1).Select
ElseIf ActiveCell.Value = " " Then
ActiveCell.Clear
ActiveCell.Offset(0, 1).Select
Else
ActiveCell.Offset(0, 1).Select

Loop

 
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
do while loop problem April Excel Discussion (Misc queries) 4 October 18th 09 07:51 PM
VBA Loop Problem scrabtree23[_3_] Excel Programming 2 November 24th 04 02:17 PM
Loop Problem Todd Huttenstine Excel Programming 10 April 12th 04 06:15 PM
For..Next loop problem Dwaine Horton Excel Programming 1 February 18th 04 12:12 AM
loop problem joao Excel Programming 4 November 6th 03 02:01 PM


All times are GMT +1. The time now is 09:41 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"