Exceliscool123456789
New Member
- Joined
- Sep 5, 2023
- Messages
- 30
- Office Version
- 365
- Platform
- Windows
Im trying to write a code that will copy all the information from columns A to J from one workbook (daily occurrence) and paste it into another workbook at the end of the last row of data pasted from column A (essentially a rolling data tally).
Also, if "Sheet 1" (worksheet name) always changes daily when I download the report, how can I label it in the code accordingly?
Sheet 1 = the downloaded sheet from 3rd site
Bank rec = is the rolling data tally workbook
Dim m As Long
Dim r As Long
m = Worksheets("Sheet1").Range("A:J" & Worksheets("Sheet1").Rows.Count).End(xlUp).Row
r = Worksheets("Bank rec").Range("A" & Worksheets("Bank rec").Rows.Count).End(xlUp).Row + 1
Worksheets("Sheet1").Range("A1:J" & m).Copy Destination:=Worksheets("Bank rec").Range("A" & r)
Application.CutCopyMode = False
Also, if "Sheet 1" (worksheet name) always changes daily when I download the report, how can I label it in the code accordingly?
Sheet 1 = the downloaded sheet from 3rd site
Bank rec = is the rolling data tally workbook
Dim m As Long
Dim r As Long
m = Worksheets("Sheet1").Range("A:J" & Worksheets("Sheet1").Rows.Count).End(xlUp).Row
r = Worksheets("Bank rec").Range("A" & Worksheets("Bank rec").Rows.Count).End(xlUp).Row + 1
Worksheets("Sheet1").Range("A1:J" & m).Copy Destination:=Worksheets("Bank rec").Range("A" & r)
Application.CutCopyMode = False