VBA Code to copy rows by date from one tab to another / repeat based on new date

mlt1

New Member
Joined
Jun 30, 2021
Messages
4
Office Version
  1. 365
Platform
  1. Windows
Hello, thank you all for sharing your wealth of knowledge and experience with me. I am not a programmer and have limited knowledge concerning VBA structure. I will try to detail my thoughts and need for the code.

One workbook with multiple worksheets. VBA will only effect two worksheets (Tabs): 1) Report / 2) Response Table. Report is a scorecard based on date of entry. Response Table is where I hope to store all the entered data in Report.

Report consists of 5 columns: (G, H, I, J, K), 28 rows with 6 blank rows for future additions.
Column H is a Date which I would like to copy and store the data.

I created a macro to copy and paste the data from Report to Response Table. The issue is when the next day's entries are complete and I run the macro, the previous dates data is over written. How to I write code so the new date's data will begin at the first open row? I have researched and tried a couple differing code formats, but I have not succeeded.

Thank you in advance and your direction.
Mlt
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I created a macro to copy and paste the data from Report to Response Table.
Please share the working code you have so far. It will be easier to add to what you already have (that is working).
 
Upvote 0
Sub postnotes2()
'
' postnotes2 Macro
'

'
Range("A2").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[7]C"
Range("B2").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[7]C[5]"
Range("C2").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[7]C[5]"
Range("D2").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[7]C[5]"
Range("E2").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[7]C[5]"
Range("F2").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[7]C[5]"
Range("A2:F2").Select
Selection.AutoFill Destination:=Range("A2:F19"), Type:=xlFillDefault
Range("A2:F19").Select
Range("A21").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[9]C"
Range("B21").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[9]C[5]"
Range("C21").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[9]C[5]"
Range("D21").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[9]C[5]"
Range("E21").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[9]C[5]"
Range("F21").Select
ActiveCell.FormulaR1C1 = "=+'Report '!R[9]C[5]"
Range("A21:F21").Select
Selection.AutoFill Destination:=Range("A21:F25"), Type:=xlFillDefault
Range("A21:F25").Select
Range("f25").Select
Sub MoveDown_ActiveCell()
ActiveCell.Offset(1).Select
Sub For_Loop()
Dim X As Long


End Sub


I am trying to find a solution to restarting from A2 if the week number is different from the last copy. Hopefully, this makes sense. Thanks again!
 
Upvote 0
The code you posted doesn't compile - you can't have an orphan 'Sub" line inside another subroutine.

Perhaps you could explain what actual range you want to copy from the Report to the Response Table sheets, and where exactly you want the data pasted (presumably the first empty row?).
Also, could you share your file via Google Drive, Dropbox or similar file sharing platform, or post your actual sheets using the XL2BB add in.
 
Upvote 0

Forum statistics

Threads
1,223,884
Messages
6,175,177
Members
452,615
Latest member
bogeys2birdies

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