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

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

yky

Well-known Member
Joined
Jun 7, 2011
Messages
1,796
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,119,076
Messages
5,575,988
Members
412,693
Latest member
SJC2020
Top