Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Search column for date format; cut and paste multiple cells to row above

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default Search column for date format; cut and paste multiple cells to row above

MaryGHunter wrote:

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

--
The siren sings a lonely song of all the wants and hungers...
Reply
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
Search , then copy and paste from multiple worksheets. VBA help [email protected] Excel Programming 1 October 30th 12 02:19 AM
search, copy and paste through multiple sheets Jeff S.[_2_] Excel Discussion (Misc queries) 1 August 16th 09 12:08 AM
search and paste information - multiple pages JO Excel Worksheet Functions 0 June 24th 08 11:13 PM
Search for multiple cells with a row for matching criteria, then sum up certain column drdavidge Excel Programming 3 August 8th 06 06:08 PM
Search Column then Paste Data at end of Row? [email protected] Excel Programming 11 May 16th 06 09:02 PM


All times are GMT +1. The time now is 10:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"