Delete Rows from Selection that contain "Date"

toddscott

New Member
Joined
Jul 13, 2010
Messages
8
I am having luck compiling a months worth of daily spreadsheets into one monthly spreadsheet using the macros found by using search. I have also been able to remove the blank rows the macro inserted by using another macro found here.

Now I just need to remove rows that contain the word "Date" in column A. The cells that contain the word "Date" are formatted as general on the number tab. All other cells in the A column are formatted as date on the number tab (they contain dates). I would like to be able to select certain rows and then run the macro which will delete all rows in the selection that contain the text "Date". I just can't figure out the macro.

Todd
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Hi,

Perhaps try:

Code:
Sub Try()

Dim c As Range

For Each c In Selection
    If InStr(c, "Date") <> 0 Then
        c.EntireRow.Delete
    End If
Next c

End Sub
 
Last edited:
Upvote 0
I tried the first code while you were editing it. This code seems to work perfect. Problem solved and I will learn from your code.

Thank you very much.

Todd
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,537
Messages
6,179,408
Members
452,912
Latest member
alicemil

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
Back
Top