Results 1 to 4 of 4

Image Catalogue Macro

Threaded View

chris391 Image Catalogue Macro 08-21-2012, 07:34 AM
K m Re: Image Catalogue Macro 08-21-2012, 07:59 AM
chris391 Re: Image Catalogue Macro 08-21-2012, 08:02 AM
chris391 Re: Image Catalogue Macro 08-21-2012, 12:25 PM
  1. #1
    Registered User
    Join Date
    07-11-2012
    Location
    Epsom
    MS-Off Ver
    Excel 2007
    Posts
    8

    Smile Image Catalogue Macro

    Hi there, hoping someone can help!

    I currently have a macro enabled image catalogue that imports images based on name (column A), location (B) and puts them in the spreadsheet however they all appear at the top of the spreadsheet as different sizes.

    I was wondering if somone could modify my macro below so all the images appear the same size and in each row so they can be seen by the customer. I have also attached the spreadsheet I need to use.
    Sub InsertPictures()
    Dim row As Long
    Dim picPath As String
    Dim Picture As Object
    
    row = 1
    
    On Error Resume Next
    
    While Cells(row, 1) <> ""
      Cells(row, 3).Select
      
      ' just guess what type of picture it is: .jpg or .gif
      picPath = Cells(row, 2) & Cells(row, 1) & ".gif"
      ActiveSheet.Pictures.Insert(picPath).Select
      picPath = Cells(row, 2) & Cells(row, 1) & ".jpg"
      ActiveSheet.Pictures.Insert(picPath).Select
      
      Set Picture = Selection
      'set cell height to picture size
      Picture.Top = Picture.TopLeftCell.Top
      Picture.Left = Picture.TopLeftCell.Left
      Picture.TopLeftCell.EntireRow.RowHeight = Picture.Height
      
      row = row + 1
    
    Wend
    End Sub
    Thanks for your help.

    Chris
    Attached Files Attached Files
    Last edited by chris391; 08-23-2012 at 08:05 AM.

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