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?
 

Some videos you may like

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,755
Office Version
  1. 2010
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,114,652
Messages
5,549,209
Members
410,905
Latest member
Extjel
Top