+ Reply to Thread
Results 1 to 3 of 3

Inserting pictures into multiple sheets

Hybrid View

slowokan Inserting pictures into... 12-03-2011, 02:23 PM
mrice Re: Inserting pictures into... 12-03-2011, 02:46 PM
slowokan Re: Inserting pictures into... 12-03-2011, 05:39 PM
  1. #1
    Registered User
    Join Date
    12-03-2011
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Inserting pictures into multiple sheets

    Hi everybody.

    I tried for a long time, but I couldn't sort out how to insert pictures to multiple sheets on the same workbook, by pressing the button on the first sheet.

    I want to press the button on the first sheet and see the pictures (from a folder on my computer) show up on the other sheets. Is it possible on Excel 2010?

    Thanks in advance!

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Inserting pictures into multiple sheets

    Try this macro

    Sub Test()
    Const MyPath = "C:\Documents and Settings\Me\My Documents\My Pictures\"
    
    MyFileName = Dir(MyPath & "*.jpg")
    Do While MyFileName <> ""
        Sheets.Add After:=Sheets(Sheets.Count)
        ActiveSheet.Pictures.Insert(MyPath & MyFileName).Select
        MyFileName = Dir()
    Loop
    End Sub
    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007.

  3. #3
    Registered User
    Join Date
    12-03-2011
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2010
    Posts
    2

    Question Re: Inserting pictures into multiple sheets

    Thank you, mrice...

    The exact thing I need is, when I click the button (created by me) on the 1st sheet, the macro will insert a picture into Sheet2 or Sheet3, it doesn't matter which sheet it inserts. And I want to stay on the first sheet, instead of switching to the sheet, which the picture shows up.

    Thank you for your efforts.

+ 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