Vba Header picture from worksheet

Volteius

New Member
Joined
Apr 29, 2015
Messages
12
Hi everyone!

I use this code to put the "logo.jpg" into the header

With Worksheets("Test").PageSetup.LeftHeaderPicture
.Filename = "C:\Test\Logo.jpg"
.Height = 150
.Width = 200
'.Brightness = 0.36
'.ColorType = msoPictureAutomatic
'.Contrast = 0.39
.CropBottom = 0
.CropLeft = 0
.CropRight = 0
.CropTop = 0
End With

Is there a way to use an internal image, for example an image inside a cell called "LOGO", without using an external jpg?
 

Excel Facts

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.
Images are on their own layer, not inside any cell. They appear to be in cells because the coordinations overlap.

Try the following code.

Code:
Dim shp As Shape

Set shp = ThisWorkbook.Sheets(1).Shapes("LOGO") 'need to find out the name of the shape you want to copy

shp.Copy

ThisWorkbook.Sheets(1).Paste

With Selection
.Top = 50 'plug in desired coordinateion
.Left = 100
End With
 
Upvote 0

Forum statistics

Threads
1,214,829
Messages
6,121,827
Members
449,051
Latest member
excelquestion515

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