VBA Macro - Copy and paste data into worksheet in a specific row based on date

bleedUTorange

New Member
Joined
Aug 3, 2011
Messages
9
I have a report that is updated daily. I have specific cells in one sheet ("Paste") that need to be copied over to another sheet ("Team") in a specific row based on a specific date. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
Cells D8:D25 in worksheet ("Paste") has the date of reference. So I need the Macro to find that date in column D within ("Paste") copy the needed data in B8:C8 (‘this is needed all the way down to B25:C25’) and paste it to the row with the same date within the worksheet ("Team").<o:p></o:p>
<o:p></o:p>
Note: I am not dealing with complete columns or row, only individual cells, because the data must pertain to certain employees for that particular day. So I am assuming that each cell that needs to be copied with have its own “date statement”.<o:p></o:p>
<o:p></o:p>
Below is a sample of my code as of current. Initially I wrote to paste the appropriate data (B8:C8) to the next available cell of the specific column that didn’t have any data in it. Since the directive has change, I know it will need to be eliminated and be replaced with the “date statement”.<o:p></o:p>
<o:p></o:p>
Sheets("Paste").Visible = True<o:p></o:p>
Sheets("Paste").Select<o:p></o:p>
Range("A1").Select<o:p></o:p>
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _<o:p></o:p>
:=False, Transpose:=False<o:p></o:p>
<o:p></o:p>
Sheets("Paste").Select<o:p></o:p>
Range("b8").Select<o:p></o:p>
Selection.Copy<o:p></o:p>
Sheets("Team").Select<o:p></o:p>
Columns("f:f").Select<o:p></o:p>
Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, lookat _<o:p></o:p>
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _<o:p></o:p>
False).Activate<o:p></o:p>
ActiveCell.Select<o:p></o:p>
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _<o:p></o:p>
False, Transpose:=False<o:p></o:p>
<o:p></o:p>
Sheets("Paste").Select<o:p></o:p>
Range("c8").Select<o:p></o:p>
Selection.Copy<o:p></o:p>
Sheets("Team").Select<o:p></o:p>
Columns("g:g").Select<o:p></o:p>
Selection.Find(What:="", After:=ActiveCell, LookIn:=xlFormulas, lookat _<o:p></o:p>
:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlNext, MatchCase:= _<o:p></o:p>
False).Activate<o:p></o:p>
ActiveCell.Select<o:p></o:p>
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _<o:p></o:p>
False, Transpose:=False <o:p></o:p>
<o:p></o:p>

If I happen to confuse you, unfortunately I could do easily, or need more information please ask me questions so I can help you to help me.
<o:p></o:p>
I'm very new to VB, but can usually follow code logic pretty well. Let me know if you need any more information from me. Thank you so much!<o:p></o:p>
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.

Forum statistics

Threads
1,224,583
Messages
6,179,682
Members
452,937
Latest member
Bhg1984

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