macro to copy background of a sheet

IgorDepecker

New Member
Joined
Jan 8, 2005
Messages
35
Hi all,

I ' m looking for VBA code to copy the background from a specific sheet to another. The background of a sheet is not included in "copy paste special formats" so this doesn't work. Somebody an idea ?
Txs ! !
Igor
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
L

Legacy 98055

Guest
I do not know how you can do that? See the SetBackgroundPicture Method in VBA help to dynamically load the background from a file.
 

erik.van.geit

MrExcel MVP
Joined
Feb 1, 2003
Messages
17,832
Hi,

if Tom doesn't know, who would ? perhaps Rafaaj2000 can invent some APIprocedure :)
the only workaround I can see, is this:

sheet2 needs background from sheet1
copy sheet "sheet1" (default name: sheet1 (2) )
clear "sheet1 (2)"
copy contents of "sheet2" to "sheet1 (2)"
delete "sheet2"
rename "sheet1 (2)" to "sheet2"


alternatively: if you want to do this often
when changing background, put the picture-path somewhere in a cell: you would only need to read the cell (and hope the picture was not moved )

kind regards,
Erik
 

Forum statistics

Threads
1,136,261
Messages
5,674,702
Members
419,520
Latest member
Jennifer4Dillon

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