Copy only texts and values only but not formulas from one workbook to another

pincivma

Board Regular
Joined
Dec 12, 2004
Messages
206
Is there a macro that copies only text and values but leaves the formulas in their cells when copying ranges from one workbook to another? Some ranges have formula in them but I do not want to copy them from one workbook to another.

ODIN was kind enough to send me the code that copies formulas from workbook1 to workbook2. Here is the code he gave me. I modified it a bit. Now I need a macro that copies everything else but formulas from workbook1 to workbook2. Just to be clear, Workbook1 range("B9:H428) has both text and numbers and formulas. I want to copy over everything in Range("B9:H428) from workbook1 to workbook2 except formulas. In other words, if a formula is in say cell D15 in workbook1, this cell does not get copied over to cell D15 in workbook2. Cell D15 in workbook2 might have a different formula in there and I want that formula to stay in Cell D15.

Sub Test()

Application.ScreenUpdating = False

Application.EnableEvents = False

Workbooks("worbook2").Worksheets("Sheet1").Range("B9:H428").Formula = Workbooks("workbook1").Worksheets("Sheet1").Range("B9:H428").Formula
 

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.

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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