+ Reply to Thread
Results 1 to 4 of 4

insert picture in an exact range in rows with steps

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2010
    Posts
    155

    insert picture in an exact range in rows with steps

    I tried to embed a new part into an existing code which could be insert a picture from a path (example C:\).
    The size of the picture should be exact match with range C2:D2. When the code is run place the next picture in next row C2+31 : D2+31.

    I tried this one but it's not working.

     With Worksheets("LABEL")
     szPicFileName = Range("J2").Value
     Set pic = ActiveSheet.Pictures.Insert(szPicFileName)
        r = 1
        For i = 2 To UBound(a)
     
            .Range("d4:d26") = Application.Transpose(Array(a(i, 1)))
                       
        With .Range("A1:F31")
                .Copy Worksheets("sheet6").Range("a" & r)
                
            rFirstRow = 2 + r
            rLastRow = 2 + r
            cFirstColumn = 3
            cLastColumn = 4
            Set Rng = Range(Cells(rFirstRow, cFirstColumn), Cells(rLastRow, cLastColumn))
            With pic
                .Height = Rng.Height
                .Width = Rng.Width
                .Left = Rng.Left
                .Top = Rng.Top
            End With
                        
                Worksheets("sheet6").Rows(r + 1).RowHeight = 73
                
         End With
                          
            r = r + 31
                 
        Next
        
    End With

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: insert picture in an exact range in rows with steps

    attach a sample file
    If solved remember to mark Thread as solved

  3. #3
    Forum Contributor
    Join Date
    04-21-2010
    Location
    Budapest
    MS-Off Ver
    Excel 2010
    Posts
    155

    Re: insert picture in an exact range in rows with steps

    I attached the sample file.
    Attached Images Attached Images
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: insert picture in an exact range in rows with steps

    I did not understand what do you want

+ 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