+ Reply to Thread
Results 1 to 3 of 3

Insert multiple images into excel across two columns

  1. #1
    Registered User
    Join Date
    09-28-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Insert multiple images into excel across two columns

    Hi Everyone,

    Hoping I can get some help please (basic vba knowledge here). I have a code that allows me to open a folder and download multiple images from a specified point (A7) into every second row (and autofit to the current row height). All of this works like a dream... except for the life of me I cannot work out how to load the images across columns A and B. For example I select 5 images from my folder which loads to cells A7, B7, A9, B9, A11 etc (or every second row from A7 and B7). Currently the images load at A7, A9, A11 etc.

    I have played with selecting different ranges etc but I just don't have the experience to understand how to upload the images in both columns A and B into every second row? If anyone is able to assist that would be greatly appreciated. The code is below.

    Thank you in advance

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Insert multiple images into excel across two columns

    Hi Natstin,

    I used a counter to determine when to go to the next column or the next row. The constant nITEMS_PER_ROW can be changed to determine how many items go on each row.

    You were very close. Try the following:
    Please Login or Register  to view this content.
    It is a best practice to declare all variables. If you misspell a variable in your code, VBA will silently assume it is a Variant variable and go on executing with no clue to you that you have a bug. Go to the VBA development window, click Tools, Options, and check "Require Variable Declaration." This will insert the following line at the top of all new modules:
    Please Login or Register  to view this content.
    This option requires all variables to be declared and will give a compiler error for undeclared variables.

    Lewis

  3. #3
    Registered User
    Join Date
    09-28-2012
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: Insert multiple images into excel across two columns

    Thank you so much Lewis, that works perfectly and I have updated my Tools/Options with Require Variable Declaration now as well.

    I really appreciated your help with this, thank you

+ 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. Insert product images into cells in excel MAC
    By mrcomputeer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-02-2014, 01:31 PM
  2. Macro to Insert Multiple Images to Multiple Sheet of a Excel Workbook.
    By Nimalan_Dude in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-07-2014, 11:18 PM
  3. 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
  4. 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
  5. 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
  6. Insert Multiple Images (GIFs) from File
    By meperson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-04-2012, 02:49 AM
  7. 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

Tags for this Thread

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