+ Reply to Thread
Results 1 to 4 of 4

Thread: how to Insert picture in multiple sheets from 1 drop down?

  1. #1
    Registered User
    Join Date
    08-12-2009
    Location
    Cape Town, South Africa
    MS-Off Ver
    Excel 2003
    Posts
    1

    Question how to Insert picture in multiple sheets from 1 drop down?

    Morning All

    I am wanting to automatically insert a graphic file (jpg) into an excel document, but have it appear on multiple sheets. The closest Macro i could find was from
    http://www.mcgimpsey.com/excel/lookuppics.html
    but that only works for 1 cell on 1 sheet... macro for above is :
    Private Sub Worksheet_Calculate()
            Dim oPic As Picture
            Me.Pictures.Visible = False
            With Range("F1")
                For Each oPic In Me.Pictures
                    If oPic.Name = .Text Then
                        oPic.Visible = True
                        oPic.Top = .Top
                        oPic.Left = .Left
                        Exit For
                    End If
                Next oPic
            End With
        End Sub
    Any advise or help you could offer would be greatly appreciated!
    Last edited by mgreen; 08-12-2009 at 06:27 AM.

  2. #2
    Valued Forum Contributor MickG's Avatar
    Join Date
    11-23-2007
    Location
    Banbury,Oxfordshire
    Posts
    888

    Re: Help Needed : Insert picture in multiple sheets from 1 drop down

    Hi, This will Place a Picture from file on each Sheet in WorkBook.
    Change Path, Picture Name, Ranges to Suit.
    Sub MG12Aug03
    Dim Pth As String, Pic As String, Fpth As String, Sht As Worksheet
    Application.ScreenUpdating = False
    Pic = "MyPic" 'Picture Name and File Path Below
    Pth = "C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\"
        Fpth = Pth & Pic & ".jpg"
    
    For Each Sht In ActiveWorkbook.Worksheets
     Sht.Select
    ActiveSheet.Pictures.Insert(Fpth).Select
        With Selection
            .Height = 100
            .Width = 200
            .top = Range("z1").top
            .Left = Range("z1").Left
            
    End With
     Next Sht
    Application.ScreenUpdating = True
    End Sub
    Regards Mick

  3. #3
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639

    Re: Help Needed : Insert picture in multiple sheets from 1 drop down

    Your post does not comply with Rule 1 of our Forum RULES. Your post title should accurately and concisely describe your problem, not your anticipated solution. Use terms appropriate to a Google search. Poor thread titles, like Please Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will be addressed according to the OP's experience in the forum: If you have less than 10 posts, expect (and respond to) a request to change your thread title. If you have 10 or more posts, expect your post to be locked, so you can start a new thread with an appropriate title.
    To change a Title on your post, click EDIT then Go Advanced and change your title, if 2 days have passed ask a moderator to do it for you.
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

  4. #4
    Forum Guru, retired Admin royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    25,639

    Re: Help Needed : Insert picture in multiple sheets from 1 drop down

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need

    For Excel Tips & Solutions, free examples and tutorials why not check out my downloads

    New members please read & follow the Forum Rules

    Remember to mark your questions Solved and rate the answer(s)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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