Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() See if this works Sub sortDate() Dim FindDate As String Set Sourcesht = Sheets("sheet1") Set DestSht = Sheets("sheet2") NewRow = 1 With Sourcesht FindDate = .Range("A2") 'Format(.Range("A2"), "mm/dd/yy") RowCount = 3 Do While .Range("A" & RowCount) < "" 'find the A2 data in current row Set SearchRange = .Range("A" & RowCount & ":E" & RowCount) Set c = SearchRange.Find(what:=FindDate, _ LookIn:=xlValues, lookat:=xlWhole) If Not c Is Nothing Then 'copy date to new sheet Rows(RowCount).Copy _ Destination:=DestSht.Rows(NewRow) With DestSht Set SortRange = .Range("A" & NewRow & ":E" & NewRow) SortRange.Sort _ Header:=xlNo, _ key1:=.Range("A" & NewRow), _ order1:=xlDescending, _ Orientation:=xlLeftToRight NewRow = NewRow + 1 End With End If RowCount = RowCount + 1 Loop End With End Sub -- joel ------------------------------------------------------------------------ joel's Profile: http://www.thecodecage.com/forumz/member.php?userid=229 View this thread: http://www.thecodecage.com/forumz/sh...d.php?t=157472 Microsoft Office Help |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro Help + date | Excel Programming | |||
macro to date stamp to the right of the macro command button | Excel Programming | |||
Macro to Insert Current Date into cell - Macro to "Save As" | Excel Worksheet Functions | |||
Date Macro if B is populated then date in A | Excel Programming | |||
A macro for the today's date...not the current date | Excel Programming |