find today's date in cell, copy row and append to sheet 2

TurboBDogg

New Member
Joined
Jan 31, 2012
Messages
4
Longtime user, first time poster.

I know I have done this before, I just cannot figure out how to code it today for some reason.

Basically what I have is a sheet full of data containing todays orders, and I need to review the sheet, find todays date in column E (project created date), and append that entire row of data onto sheet 2, starting with row 2.

I can write most of this, but I am having issues writing the - search for "today", copy corresponding row, and paste to sheet 2 (repeating). It could be that it is early, or that I did not have any coffee today, but if someone could help me out, I would appreciate it.

Here are the raw column headers with a bit of data:
Headers
Buyer Name Project Type Project Name Job Number Project Created Date Project Original Close Date Project Status Customer Name Date Won Dollars Quoted/Sold Estimate Status Job# If Won Product Code Sales Rep

Row1
john smith A Quote 123 company 1234 2/1/2012 2/1/2012 Closed 123 compnay 2/1/2012 123456 Won products jane doe

Row 2
smithy johns A Quote 321 company 4321 2/1/2012 2/1/2012 Closed 321 comp inc Open productos doe jane

I am on an old computer, and using 2007, so many of my tools are not working with me today (which may be half the issue)

Any help would be appreciated.
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
Code:
[color=darkblue]Sub[/color] Copy_Todays_Orders()
    
    [color=darkblue]Dim[/color] rngSearch [color=darkblue]As[/color] Range, wsDest [color=darkblue]As[/color] Worksheet
    [color=darkblue]Dim[/color] Found [color=darkblue]As[/color] Range, Firstfound [color=darkblue]As[/color] [color=darkblue]String[/color]
    [color=darkblue]Dim[/color] NextRow [color=darkblue]As[/color] [color=darkblue]Long[/color], Counter [color=darkblue]As[/color] [color=darkblue]Long[/color]
    
    [color=darkblue]Set[/color] rngSearch = Sheets("Sheet1").Range("E:E")
    [color=darkblue]Set[/color] wsDest = Sheets("Sheet2")
        
    [color=darkblue]Set[/color] Found = rngSearch.Find(What:=Date, _
                               LookIn:=xlValues, _
                               LookAt:=xlWhole, _
                               SearchOrder:=xlByRows, _
                               SearchDirection:=xlNext, _
                               MatchCase:=False)
        
    [color=darkblue]If[/color] Found [color=darkblue]Is[/color] [color=darkblue]Nothing[/color] [color=darkblue]Then[/color]
        MsgBox "No orders found for today's date. ", , "No Orders Found"
        
    [color=darkblue]Else[/color]
        Application.ScreenUpdating = [color=darkblue]False[/color]
        Firstfound = Found.Address
        [color=darkblue]Do[/color]
            NextRow = wsDest.Range("A" & Rows.Count).End(xlUp).Row + 1
            Counter = Counter + 1
            Found.EntireRow.Copy Destination:=wsDest.Rows(NextRow)
            [color=darkblue]Set[/color] Found = rngSearch.FindNext(After:=Found)
        [color=darkblue]Loop[/color] [color=darkblue]Until[/color] Found.Address = Firstfound
        Application.ScreenUpdating = [color=darkblue]True[/color]
        MsgBox Counter & " order(s) with today's date. ", , "Copy Complete"
    [color=darkblue]End[/color] [color=darkblue]If[/color]

End [color=darkblue]Sub[/color]
 
Upvote 0

Forum statistics

Threads
1,223,240
Messages
6,170,951
Members
452,368
Latest member
jayp2104

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