Delete row with date in it

IrishJM

New Member
Joined
Dec 31, 2005
Messages
6
Ok Guy's and Girls
I get data sucked in to excel Column A is Product ID Col B is Product No Col C is Customer Name etc

Occasionally in Column A the first row for a new Day has that Date in it seeing as this is the only data in Column A that is a Date is it possible to delete this Row? By means of VB or Macro.

Thanks
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

VBA Noob

Active Member
Joined
Apr 27, 2006
Messages
353
Maybe

Code:
Sub Delete_Date()
Dim i As Long

    For i = Cells(Rows.Count, "A").End(xlUp).Row To 1 Step -1
        If IsDate(Cells(i, "A")) Then
            Rows(i).Delete
        End If
    Next i
        
End Sub

VBA Noob
 

IrishJM

New Member
Joined
Dec 31, 2005
Messages
6
VBA Noob thanks that works a treat if the sheet is called sheet1 what if it is calles something else like Daily Control.

Thanks
 

Watch MrExcel Video

Forum statistics

Threads
1,123,177
Messages
5,600,160
Members
414,367
Latest member
dw970906

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top