Ignore formula cells

cipcips

New Member
Joined
Jan 25, 2023
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
Greetings!
Is posible to write a VBA / macro to copy some data from a workbook to another (with the same structure) but to leave untouched the formula cells in the destination workbook.
In the source workbook those corespondent cell are no longer formula cell but value cell (due to another calculation).
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Welcome to the Board!

We would really need to understand the strcuture of your two files better.

What does the data in your source workbook look like?
What rows/columns are you copying?

What does the structure of your destination workbook look like?
Where do you want to paste the data, exactly?
Where do these formulas you want to keep reside on this sheet?

It find be helpful to post some small samples of your data and expected result.
MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
Thank you for replying!
Actually, the need is as follows:
Excel file “Source” and Excel file “Destination” are 99 percent similar (same structure, same cells).
The difference is that “Source” has some formula cells (on different rows or columns, not continous) and the rest of the cells are blanks.
“Destination” has only values cells and some blanks. It doesn’t have any formula cells, as it adds values from other files.
I want to copy only the formula cells from “Source” to “Destination” and to skip or ignore the cells that are not with formula.
The method with PasteSpecial PasteFormulas from “Source” to “Destination” doesn’t work because it brings not only the formula cells but also the blanks from “Destination”, removing the values from “Destination”.
 
Upvote 0
Mistake in the last paragraph:
The method with PasteSpecial PasteFormulas from “Source” to “Destination” doesn’t work because it brings not only the formula cells but also the blanks from “Source”, removing the values from “Destination”.
 
Upvote 0
So there is no rhyme or reason where these formulas or blanks appear? It could be any columns or rows?
So some columns have both formulas and blanks?

I cannot think of any other solution other than to use VBA to loop through every single cell in both files, and determine what to do in each case.
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,271
Members
449,219
Latest member
daynle

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