ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Variable Image in Header (https://www.excelbanter.com/excel-programming/423950-variable-image-header.html)

Graham

Variable Image in Header
 
Hi

I am trying to insert an image into the header based on a variable in the
same worksheet.
I have a 'messy?' solution involving returning to a cell, a file name for an
image.

then using the following code, replace logo.jpg with the cell reference.

Sub InsertPicture()

With ActiveSheet.PageSetup.LeftHeaderPicture
.Filename = "C:\Temp\logo.jpg"
.Height = 100
.Width = 150
.Brightness = 0.36
.ColorType = msoPictureAutomatic
.Contrast = 0.39
.CropBottom = 0
.CropLeft = 0
.CropRight = 0
.CropTop = 0
End With

' Enable the image to show up in the left header.
ActiveSheet.PageSetup.LeftHeader = "&G"

End Sub




Is this a reasonable solution?
What is the syntax?

Any help is appreciated

Graham



All times are GMT +1. The time now is 05:12 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com