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

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

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,508
Messages
5,548,483
Members
410,839
Latest member
MrSumo85
Top