Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 96
Default Loop ?

I tried using the following code to update the forms below, but I obviously
have something wrong because it does nothing. What I want to do
is delete Row in which Column C is less than 1, and then shift
the next row following the deleted row to shift up to the blank row.
I only tried it for Columns A,B and C.
What do I need to do?

I know I'm asking someone to write my code, but I'm new to Excel and VB
and could sure use some help.


Sub UpdateForm()

Set CurrentRange = Range("A14:C14")

Do Until Range("C14") 0
Set NextRange = CurrentRange
If Range("C14") < 1 Then
CurrentRange.EntireRow.Delete
End If
Set CurrentRange = NextRange

Loop

End Sub


A B C G H
I
Account Date Amount Account Date Amount
14 cd 2/13/2009 4 bf 2/13/2009 6
15 wf 2/13/2009 3 af 2/13/2009 2
16 we 2/13/2009 56 gf 2/13/2009 34
17 qe 2/13/2009 23 bg 2/13/2009 16
18 rt 2/13/2009 0 fg 2/13/2009 0
19 yu 2/13/2009 23 yk 2/13/2009 45
20 ty 2/13/2009 8 lu 2/13/2009 2
21 ui 2/13/2009 9 tq 2/13/2009 8
22 op 2/13/2009 0 de 2/13/2009 0
23 th 2/13/2009 34 wc 2/13/2009 11
24 bn 2/13/2009 2 bz 2/13/2009 98
25 cv 2/13/2009 1 hm 2/13/2009 1


 
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
How to loop saman110 via OfficeKB.com Excel Discussion (Misc queries) 4 July 25th 07 01:09 AM
if & Loop steven.holloway Excel Discussion (Misc queries) 5 July 20th 07 09:50 AM
do..loop Anna Excel Discussion (Misc queries) 6 June 20th 07 01:10 PM
while loop Arun Kumar Saha Excel Worksheet Functions 2 June 19th 07 01:31 PM
help with a loop BeJay Excel Discussion (Misc queries) 3 May 19th 06 12:24 PM


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