VBA code adjustment help please. Copy paste to end of data on sheet vs overwriting data for multiple instances

roberttkim

Board Regular
Joined
Mar 5, 2009
Messages
97
Hi all. I was hoping someone could be so kind as to help me tweak my code. Currently the code opens a file and copies that information into a sheet in my workbook. It does this for 3 different files sitting in the network drive. I however would like it to rather than overwrite and paste on the designated sheets to paste below the last set of data in column A for each instance. Could someone please help?

VBA Code:
Sub RECON()

Dim NmStr As String
NmStr = ActiveWorkbook.Name
Windows(NmStr).Activate

Report = Sheets("RECON").Range("B2").Value
Workbooks.Open Filename:=Report
ActiveSheet.Cells.Copy
Windows(NmStr).Activate
Sheets("eBackOffice_Summary_LCs").Select
Range("A1").Select
ActiveSheet.Paste


Report = Sheets("RECON").Range("B3").Value
Workbooks.Open Filename:=Report
ActiveSheet.Cells.Copy
Windows(NmStr).Activate
Sheets("OpsReports_LCs_DailyTrialBalanc").Select
Range("A1").Select
ActiveSheet.Paste


Report = Sheets("RECON").Range("B4").Value
Workbooks.Open Filename:=Report
ActiveSheet.Cells.Copy
Windows(NmStr).Activate
Sheets("OpsReports_LCs_STA").Select
Range("A1").Select
ActiveSheet.Paste

End Sub
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Hi. Try to replace for the 3 instances of your code:
this line ~~~> Range("A1").Select
by this ~~~> Cells(Rows.Count, 1).End(3)(2).Select
 
Upvote 0
I'm getting an error that says to copy all cells from a worksheet make sure you paste it to the first cell. The last row of data on the sheet i want to paste it to is determined by column E. Help please?
 
Upvote 0

Forum statistics

Threads
1,214,979
Messages
6,122,550
Members
449,088
Latest member
davidcom

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