How to copy cell contents AND formatting from one workbook to another?

uk_dave&gill

Board Regular
Joined
May 17, 2007
Messages
79
I have a workbook which I access and modify ("Staff Planner") which links to another workbook which others can only view ("Planner")

The contents of Planner change when Staff Planner is updated, through formulas like:-

='[Staff Planner.xls]Plan'!D1 (which sits in Cell D1 of Planner)

Problem is, the formatting doesn't copy. I need to copy the font colours from one workbook to the other, and the only way I can do this presently is by "Copy Format" tool.

Is there any way to do this automatically?
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
So, if they are both open it can be done?

This is interesting, as, to make sure that the updates happen to Planner as they should (as this is on a shared folder and "Staff Planner" is on my PC) I use Macro Scheduler to open Planner every day at 10:00. This way, all I have to do to ensure it's up to date is save it (as it's taking the info from Staff Planner even if it's closed)

Logically then, I could get Macro Scheduler to open both, and then have some VBA to do the copying?
 
Upvote 0
Logically, yes you could. The macro would just need to Copy the UsedRange from sheet Plan in Staff Planner and Paste Special|Formats into A1 of the relevant sheet in Planner. You could use Planner's Workbook_Open event, checking that Staff Planner is open before running the rest of the code.
 
Upvote 0
Logically, yes you could. The macro would just need to Copy the UsedRange from sheet Plan in Staff Planner and Paste Special|Formats into A1 of the relevant sheet in Planner. You could use Planner's Workbook_Open event, checking that Staff Planner is open before running the rest of the code.

Can anyone help me with this? ;) I must admit I'm hopeless with coding!!
 
Upvote 0
You will never learn unless you have a go yourself]

That's me told! ;)

No, you're right of course. Trouble is I can't get my head round VBA, possibly because I spent a lot of time self-teaching myself on Superbase coding (and got quite good at it) and find it hard to "forget" one system while trying to learn another

Thanks for your help and advise
 
Upvote 0

Forum statistics

Threads
1,214,827
Messages
6,121,806
Members
449,048
Latest member
greyangel23

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