LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default Macro loop problem

Hello, I'm very new to writing macros with the Visual Basic editor, so I was
wondering if someone could help me figure out why nothing happens when I run
the following macro:

Sub RowDeletingMacro()

x = 10

Do While Cells(x, 1).Value < ""
If Cells(x, 1).Value = 0 Then
Cells(x, 1).Rows(x).Select
Selection.Delete Shift:=xlUp
End If
x = x + 1
Loop

End Sub


My goal with this macro is to delete all rows in my worksheet that have "0"
as an entry in the first column, and to skip over all of the rows that do not
have 0 as their first column entry. Any help would be greatly appreciated,
thanks very much,

Ben
 
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 Problem Dave Birley Excel Programming 2 May 10th 07 07:17 PM
Macro - Loop/automatization problem Eirik Sævareid Excel Programming 1 January 20th 07 10:19 PM
For Loop Problem Brian Matlack[_75_] Excel Programming 2 May 15th 06 09:59 PM
Problem adding charts using Do-Loop Until loop Chris Bromley[_2_] Excel Programming 2 May 23rd 05 01:31 PM
For Next loop problem Jo[_6_] Excel Programming 2 June 26th 04 12:41 AM


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