Results 1 to 6 of 6

Fill a number of Merged cells with a Picture

Threaded View

  1. #1
    Registered User
    Join Date
    05-20-2013
    Location
    Kegworth, England
    MS-Off Ver
    Excel 2019
    Posts
    58

    Fill a number of Merged cells with a Picture

    Hi all,
    I have a workbook that consists of 12 sheets, one for every month of the year. I want the user to be able to place a picture into a group of merged cells (W3 to Z10) in the January sheet. I found the following code, written by moonsaga on the forum. It works great but only puts the picture in the cell W3.


    Sub InsertPicture()
    Dim sPicture As String, pic As Picture
    sPicture = Application.GetOpenFilename _
        ("Pictures (*.gif; *.jpg; *.bmp; *.tif), *.gif; *.jpg; *.bmp; *.tif", _
         , "Select Picture to Import")
     
    If sPicture = "False" Then Exit Sub
    
    Set pic = ActiveSheet.Pictures.Insert(sPicture)
    With pic
        .ShapeRange.LockAspectRatio = msoFalse
        .Height = ActiveCell.Height
        .Width = ActiveCell.Width
        .Top = ActiveCell.Top
        .Left = ActiveCell.Left
        .Placement = xlMoveAndSize
    End With
    Set pic = Nothing
     
    End Sub
    I am new to VBA and don't even know what I want can be done.

    Any advise would be appreciated.

    Thanks.
    Last edited by AndyRoo119; 12-20-2013 at 11:28 AM. Reason: Forgot the code tags

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Fill down into merged cells without skipping rows
    By dancing-shadow in forum Excel General
    Replies: 8
    Last Post: 11-04-2013, 08:08 AM
  2. Merged cells with a number that I want to increase by 1
    By thiggy57 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-05-2013, 11:52 PM
  3. Paste picture in & have it resize to merged cells size
    By simonwilliams in forum Excel General
    Replies: 0
    Last Post: 10-02-2011, 03:12 PM
  4. Excel 2003 macro size picture to merged cells
    By 59_limo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2010, 05:31 PM
  5. Fill down into merged cells without skipping rows
    By jamesozzie in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-29-2007, 10:03 AM

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