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

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,792
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,118,812
Messages
5,574,481
Members
412,596
Latest member
nickthebizz
Top