Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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.... |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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.... |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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.... |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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.... |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Worksheet as an image | Excel Discussion (Misc queries) | |||
Hyperlink to an image in other worksheet, displaying entire image. | Excel Worksheet Functions | |||
How do I see a .ESP image (logo) that is inserted in a worksheet? | Excel Discussion (Misc queries) | |||
How to add an image to a worksheet programmatically | Excel Discussion (Misc queries) | |||
Export the worksheet background image as an image file - possible? | Excel Programming |