Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If there are no dates below your " ", then then this should work. You
will need to change resp to whatever variable you are using on the input box. Sub something() lr = ActiveSheet.Cells(Rows.Count, 7).End(xlUp).Row Set rng = ActiveSheet.Range("G2:G" & lr) resp = InputBox("enter date", "Date") dt = Format(resp, "dd/mm/yyyy") For i = lr To 2 Step - 1 If ActiveSheet.Cells(i, 7) < dt Then ActiveSheet.Cells(i, 7).EntireRow.Delete End If Next End Sub "Timbo" wrote in message ... I am working on a worksheet with dates in column G starting in G2 the last under the last row containign a date has " " in it. The dates are formatted dd/mm/yyyy. I need an input box which prompts me for a date and then formats the reply in the same way dd/mm/yyyy. I then want the macro to run down row G until it reaches the " " and delete any row with a date before the date enterred into the input box. All and any help much appreciated. -- Timbo ------------------------------------------------------------------------ Timbo's Profile: http://www.thecodecage.com/forumz/member.php?userid=24 View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=76632 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Delete rows with specific text | New Users to Excel | |||
Delete Rows Without Specific Text | Excel Worksheet Functions | |||
Macro to delete specific rows | Excel Programming | |||
Delete rows with specific text | Excel Programming | |||
Macro to delete specific rows | Excel Programming |