Copying Sheets to a new workbook switches the fill color to the new 2013 pallette.

Rob Lehman

New Member
Joined
May 11, 2012
Messages
5
I am copying selected sheets from a workbook to a new workbook so that I can publish it with values only. when I do this in Excel 2013 (the workbook was created in a prior version of Excel), it automatically adjusts my cell fill colors to the new 2013 theme colors. I want it to keep my old theme colors. I am copying the sheets via a macro, but the same thing happens when I manually copy the sheet out to a new workbook. Any ideas?? Thanks! Rob
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
You can retreive the colors from the old workbook using this code:

Code:
Dim i As Integer

For i =1 To 56
wbNew.Colors(i)=wbOld.Colors(i)
Next i

set the wbNew and wbOld to the respective workbooks :)
 
Upvote 0
So I tried this...
Code:
    Dim wbNew As Workbook
    Dim wbOld As Workbook
    Dim i As Integer
    
    Set wbOld = ActiveWorkbook()
        
    ' Copy the desired sheets
    Sheets(Array("FS1--Comparative", "IS - Other Inc-Exp Sched", "FS2--Monthly", "FS3--People", "Budget Mgr Summary", "Accruals")).Copy
    
    Set wbNew = ActiveWorkbook()
    For i = 1 To 56
        wbNew.Colors(i) = wbOld.Colors(i)
    Next I
and it didn't change anything. Didn't get any errors, but I think maybe I'm not setting wbOld and wbNew appropriately? I assumed, since the new workbook is created and activated by the Sheets.Copy line that ActiveWorkbook() would work in both places?
 
Upvote 0
That's funny, for me it does work...

It's important that the new workbook is active at the 'Set wbNew' line.

If that's not it, I have no clue, sorry
 
Upvote 0
Well...thanks much for your quick reply. I did some debug.print statements and wbNew and wbOld are identical both before and after the statement. Seems like a glitch in Excel that it would change the colors in the first place. I may just have to deal with the new colors.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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