Access Beginner
Active Member
- Joined
- Nov 8, 2010
- Messages
- 311
- Office Version
- 2016
- Platform
- Windows
Hi again,
I will have 25 Excel files all stored in the one folder. Each file will have headers commencing on A9 and will be will end at column F. All 25 files with have the same headers and these headers will be in the destination file (Reports.xlsm). The sheet I would like this copied to is called Data
I have looked at a few examples here and on the net, but haven't found one that meets my needs.
I will have a file called Reports.xlsm, can someone write some code to get data from cell A9 out to F9 and down till the last row with values in it and paste it into Reports.xlsm from A2. Then go to the next file and copy from cell A9 out to F9 and down till the last row with values in it and paste it into Reports.xlsm, from after the previously copied data and so on.
I have recorded a macro that kinda does what I want, but don't know how to get the last row with no values to paste the next copied lot of data
I will have 25 Excel files all stored in the one folder. Each file will have headers commencing on A9 and will be will end at column F. All 25 files with have the same headers and these headers will be in the destination file (Reports.xlsm). The sheet I would like this copied to is called Data
I have looked at a few examples here and on the net, but haven't found one that meets my needs.
I will have a file called Reports.xlsm, can someone write some code to get data from cell A9 out to F9 and down till the last row with values in it and paste it into Reports.xlsm from A2. Then go to the next file and copy from cell A9 out to F9 and down till the last row with values in it and paste it into Reports.xlsm, from after the previously copied data and so on.
I have recorded a macro that kinda does what I want, but don't know how to get the last row with no values to paste the next copied lot of data
Code:
Sub GetData()
'
' GetData Macro
'
'
Windows("Test1.xlsx").Activate
Range("A9:G12").Select
Selection.Copy
Windows("Report.xlsm").Activate
Range("A2").Select
ActiveSheet.Paste
End Sub