Search column for date format; cut and paste multiple cells to row above

M

MaryGHunter

I need a macro that searches column B for any cells with a date forma
(any date format). If true, I need cells (B:F) (in the same row), to b
cut and pasted to the row above in columns (D:H). Then I need tha
original row to be deleted.

I have found a few macros and functions that are similare but none tha
work for what I need.

I would greatly appreciate any help anyone can give
 
A

Auric__

MaryGHunter said:
I need a macro that searches column B for any cells with a date format
(any date format). If true, I need cells (B:F) (in the same row), to be
cut and pasted to the row above in columns (D:H). Then I need that
original row to be deleted.

I have found a few macros and functions that are similare but none that
work for what I need.

I would greatly appreciate any help anyone can give!

Test this against a *copy* of your data; don't test against live data.

Sub findDatesCopyAndKill()
For L0 = 2 To Cells.SpecialCells(xlCellTypeLastCell).Row
If IsDate(Cells(L0, 2).Value) Then
Range("B" & L0 & ":F" & L0).Copy Range("D" & L0 - 1)
Rows(L0).Delete
L0 = L0 - 1
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top