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
Bookmarks