Pasting a Dynamic Range of cells to a new workbook

imported_unknown

Active Member
Joined
Jan 13, 2002
Messages
424
How do you do this with code. I would like to automate the copying and pasting of cells to a new worksheet (monthly). For some reason, our users keep messing up the results???? I am at a loss of ideas?? Any suggestions would be great.

Thank you in advance for your support.

Mahalo!
 

Some videos you may like

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.

sagain2k

Board Regular
Joined
Sep 8, 2002
Messages
94
Try the formula: =Sheet1!A1 into a cell in Sheet3 (for example). Then you can Copy/Paste or use Fill Right and Fill Down from that formula to automatically generate more refereces.

If you want VBA to create that reference formula for you, something like the code below will work. Hope this helps!

--Ray

'ENTERING THE REFERENCE FORMULA
ActiveCell.Formula = "=Sheet1!A3"

ActiveCell.Copy 'COPIES THE REFERENCE

'SELECTS THE RANGE FROM ACTIVE CELL TO
'CELL OFFSET BY 4 ROWS & 6 COLUMNS
Range(ActiveCell.Address & ":" & ActiveCell.Offset(4, 6).Address).Select

ActiveSheet.Paste 'PASTES ALL THE REFERENCES
 

Watch MrExcel Video

Forum statistics

Threads
1,122,818
Messages
5,598,280
Members
414,223
Latest member
Accountant2B

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
Top