+ Reply to Thread
Results 1 to 7 of 7

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

  1. #1
    Corey
    Guest

    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....

  2. #2
    Corey
    Guest

    Re: 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" <[email protected]> wrote in message news:[email protected]...
    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. #3
    Norman Jones
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    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. #4
    Corey
    Guest

    Re: 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" <[email protected]> wrote in message
    > news:[email protected]...
    > 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. #5
    Norman Jones
    Guest

    Re: 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



  6. #6
    Corey
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #7
    Norman Jones
    Guest

    Re: 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



+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1