+ Reply to Thread
Results 1 to 2 of 2

Macro to Insert Multiple Images to Multiple Sheet of a Excel Workbook.

  1. #1
    Registered User
    Join Date
    09-04-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    2

    Macro to Insert Multiple Images to Multiple Sheet of a Excel Workbook.

    Hello Everyone,
    Greetings to All.

    I have some Issues in the below Macro.
    My intention is to Copy/Insert the multiple Images in a folder that I select to the multiple sheets of a excel workbook.
    The Macro should only have to insert the select images to the sheets.
    The sheets are named as "Sheet1, Sheet2, Sheet3... etc..."
    And Suppose if there are 20 Sheets in the workbook and I have 10 Images to insert it in Sheet1, Sheet2..........Sheet10, then I want to delete the remaining sheets(that is Sheet11, Sheet12.....Sheet20).

    Currently I'm using the below Macro, But it is not working.
    Could anyone write/modify the macro to above said conditions.

    Thanks in Advance.

    Sub Insert_Picture()
    Dim myPicture As Variant
    Dim myCell As Range
    Dim lLoop As Long
    Dim Sht As Worksheet
    On Error Resume Next
    myPicture = Application.GetOpenFilename _
    ("Pictures (*.gif; *.jpg; *.bmp; *.tif; *.png),*.gif; *.jpg; *.bmp; *.tif *.png", , "SELECT FILE(S) TO IMPORT", MultiSelect:=True)
    If VarType(myPicture) = vbBoolean Then
    MsgBox "NO FILES SELECTED"
    Else
    For lLoop = LBound(myPicture) To UBound(myPicture)
    For Each Sht In ActiveWorkbook.Worksheets
    Sht.Select

    With ActiveSheet
    Set myCell = .Range("I4:S26")
    .Pictures.Insert(myPicture).Select

    With myCell
    Selection.Top = .Top
    Selection.Left = .Left
    Selection.Width = .Width
    Selection.Height = .Height
    Selection.Placement = xlMoveAndSize ' move and size with cells
    End With
    End With
    Next Sht
    Application.ScreenUpdating = True

    Next lLoop
    End If
    End Sub

  2. #2
    Registered User
    Join Date
    09-04-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    2

    Re: Macro to Insert Multiple Images to Multiple Sheet of a Excel Workbook.

    Could anyone write a Code for the above condition please.
    I'm waiting for the replies.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Need to Insert and save multiple images in excel
    By vasu.meesala in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2014, 02:10 PM
  2. Replies: 0
    Last Post: 07-02-2014, 03:04 PM
  3. Insert Multiple Images to excel sheet
    By celtic king in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-10-2014, 04:13 PM
  4. Insert multiple images from file in excel
    By meperson in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-04-2012, 03:29 PM
  5. Insert and Sort Multiple Images into Excel
    By plasma33 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-21-2012, 11:07 PM

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