LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default 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
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 code error help!!!! cesaoes Excel Discussion (Misc queries) 2 January 29th 08 04:52 PM
Loop for VBA code? paulinoluciano Excel Worksheet Functions 5 December 28th 05 01:30 PM
How to Loop some code Phil Osman Excel Discussion (Misc queries) 2 August 19th 05 11:14 AM
VB for excel, how do I loop through code steve hobden via OfficeKB.com Excel Discussion (Misc queries) 2 June 9th 05 01:59 PM
VBA Newbie: Help with Do Loop code Carl Excel Discussion (Misc queries) 3 December 2nd 04 07:04 PM


All times are GMT +1. The time now is 04:14 AM.

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"