Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
loop code on cell range
Please help,I am new to code and want to do the following.
I need to delete information on a worksheet which are older than a specified date and then loop the code through a range up to 500 times.The macro evaluate the date in cell a3 and if the date are older than than today less let say 30 days it should then clear contents through range a3:q3 and move to a4 and so on. this is the code as i have it at the moment and it works fine except that i have to repeat the code for each roe in the range.Is there another way to do this? Sub Button10_Click() UserForm2.Show If Range("r3") = Range("r1") Then Range("a3:q3").Select Selection.ClearContents Range("a3").Select ElseIf Range("r3") < Range("r1") Then End If Sub Button10_Click() UserForm2.Show If Range("r43") = Range("r1") Then Range("a4:q4").Select Selection.ClearContents Range("a4").Select ElseIf Range("r4") < Range("r1") Then End If |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
loop code error help!!!! | Excel Discussion (Misc queries) | |||
Loop for VBA code? | Excel Worksheet Functions | |||
How to Loop some code | Excel Discussion (Misc queries) | |||
VB for excel, how do I loop through code | Excel Discussion (Misc queries) | |||
VBA Newbie: Help with Do Loop code | Excel Discussion (Misc queries) |