ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Image to appear on all worksheets if placed on 1 worksheet. POSSIBLE ? (https://www.excelbanter.com/excel-programming/370215-image-appear-all-worksheets-if-placed-1-worksheet-possible.html)

Corey

Image to appear on all worksheets if placed on 1 worksheet. POSSIBLE ?
 
Is it possible to place say a JPG or Logo onto say worksheet 1 and ALL the worksheets in that workbook, will ALSO have that image placed
in the same position as the image in worksheet 1?

I do not what it to be placed into the header though.
If so, how would I go about this?

Corey....

Corey

Image to appear on all worksheets if placed on 1 worksheet. POSSIBLE ?
 
Or alternately is it possible to set up a macro that will prompt for a (jpg or gif) image on the PC, then after
selecting a image it is placed into a range of cells on a specific worksheet?

Is this possible?
How?

Corey....
"Corey" wrote in message ...
Is it possible to place say a JPG or Logo onto say worksheet 1 and ALL the worksheets in that workbook, will ALSO have that image placed
in the same position as the image in worksheet 1?

I do not what it to be placed into the header though.
If so, how would I go about this?

Corey....

Norman Jones

Image to appear on all worksheets if placed on 1 worksheet. POSSIBLE ?
 
Hi Corey,

Try something like:

'=============
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim rng As Range
Dim myPic As Picture
Const sAddress As String = "D1" '<<==== CHANGE
Const sStr As String = _
"C:\My Pictures\Excel.bmp" '<<==== CHANGE
Set WB = ThisWorkbook '<<==== CHANGE

For Each SH In WB.Worksheets
Set rng = SH.Range(sAddress)
Set myPic = SH.Pictures.Insert(sStr)
With myPic
.Top = rng.Top
.Left = rng.Left
End With
Next SH
End Sub
'<<=============


---
Regards,
Norman


"Corey" wrote in message
...
Is it possible to place say a JPG or Logo onto say worksheet 1 and ALL the
worksheets in that workbook, will ALSO have that image placed
in the same position as the image in worksheet 1?

I do not what it to be placed into the header though.
If so, how would I go about this?

Corey....



Corey

Image to appear on all worksheets if placed on 1 worksheet. POSSIBLE ?
 
Thanks.
Norman, or anyone else.
Is the below code able to be enhanced with a PROMPT to manually choose the
image then it placed in the designated cell?

'=============
Public Sub Tester()
Dim WB As Workbook
Dim SH As Worksheet
Dim rng As Range
Dim myPic As Picture
Const sAddress As String = "A1"
Const sStr As String = _
"C:\My Pictures\Excel.bmp" '<<==== CHANGE to whatever
the result of the prompt is
Set WB = Activeworkbook
For Each SH In WB.Worksheets
Set rng = SH.Range(sAddress)
Set myPic = SH.Pictures.Insert(sStr)
With myPic
.Top = rng.Top
.Left = rng.Left
End With
Next SH
End Sub
'<<=============

Corey....
---
Regards,
Norman


"Corey" wrote in message
...
Is it possible to place say a JPG or Logo onto say worksheet 1 and ALL the
worksheets in that workbook, will ALSO have that image placed
in the same position as the image in worksheet 1?

I do not what it to be placed into the header though.
If so, how would I go about this?

Corey....




Norman Jones

Image to appear on all worksheets if placed on 1 worksheet. POSSIBLE ?
 
Hi Corey,

Norman, or anyone else.
Is the below code able to be enhanced with a PROMPT to manually choose the
image then it placed in the designated cell?


Try:
'=============
Public Sub Tester2()
Dim WB As Workbook
Dim SH As Worksheet
Dim rng As Range
Dim myPic As Picture
Dim res As Variant
Const sAddress As String = "D1" '<<==== CHANGE
Set WB = ThisWorkbook '<<==== CHANGE

res = Application.GetOpenFilename _
("Bitmap Files (*.bmp), *.bmp")
If res = False Then Exit Sub

For Each SH In WB.Worksheets
Set rng = SH.Range(sAddress)
Set myPic = SH.Pictures.Insert(res)
With myPic
.Top = rng.Top
.Left = rng.Left
End With
Next SH
End Sub
'<<=============

---
Regards,
Norman



Corey

Image to appear on all worksheets if placed on 1 worksheet. POSSIBLE ?
 
Thank You again Norman,
You are a true gentleman.

Exactly as required.
Thanks

Corey....
"Norman Jones" wrote in message
...
Hi Corey,

Norman, or anyone else.
Is the below code able to be enhanced with a PROMPT to manually choose
the image then it placed in the designated cell?


Try:
'=============
Public Sub Tester2()
Dim WB As Workbook
Dim SH As Worksheet
Dim rng As Range
Dim myPic As Picture
Dim res As Variant
Const sAddress As String = "D1" '<<==== CHANGE
Set WB = ThisWorkbook '<<==== CHANGE

res = Application.GetOpenFilename _
("Bitmap Files (*.bmp), *.bmp")
If res = False Then Exit Sub

For Each SH In WB.Worksheets
Set rng = SH.Range(sAddress)
Set myPic = SH.Pictures.Insert(res)
With myPic
.Top = rng.Top
.Left = rng.Left
End With
Next SH
End Sub
'<<=============

---
Regards,
Norman





Norman Jones

Image to appear on all worksheets if placed on 1 worksheet. POSSIBLE ?
 
Hi Corey,

If you wish to enable the user to select bmp or jpg files, try changing:

res = Application.GetOpenFilename _
("Bitmap Files (*.bmp), *.bmp")


to

res = Application.GetOpenFilename _
("Image Files (*.bmp;*.jpg), *.bmp;*.jpg")

---
Regards,
Norman




All times are GMT +1. The time now is 06:21 PM.

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