Results 1 to 18 of 18

Insert Picture to excel from subfolders and save as folder name

Threaded View

  1. #1
    Registered User
    Join Date
    02-02-2013
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    17

    Insert Picture to excel from subfolders and save as folder name

    Hi i am new to macros and i am using below code to insert picture to excel from subfolders.
    I am having sub folders under C:/picture/..ex: sub1,sub2,sub3,sub4 etc and each folders having jpeg files..I need to open separate worksheet for each subfolder and insert pictures in each folder and save as sub1.xls,sub2.xls,sub3.xls in a loop.

    I have around 1000 sub folders under c:\pictures
       Sub insertpicture()
    
    
      Range("A6").Select
       ActiveSheet.Pictures.Insert( _
            "C:\picture\subfolder1\pic01.jpg" _
            ).Select
          
    
    With Selection
    .Left = Range("A6").Left
    .Top = Range("A6").Top
    .ShapeRange.LockAspectRatio = msoFalse
    .ShapeRange.Height = 400#
    .ShapeRange.Width = 480#
    .ShapeRange.Rotation = 0#
    End With
    
    End Sub
    Last edited by JBeaucaire; 02-13-2013 at 01:47 PM. Reason: Added code tags, as per forum rules. Don't forget!

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