Skip to main content

Posts

Showing posts with the label Excel Macro to paste all the images in excel book one after the other

Excel Macro to paste all the images in excel book one after the other

Excel Macro to paste all the images in excel book one after the other Dim MyFolder As String, fn As String, i As Long MyFolder = "C:\Pictures\" If Right$(MyFolder, 1) <> "\" Then MyFolder = MyFolder & "\" fn = Dir(MyFolder & "*.jpg") i = 2 Do While fn <> "" Set p = ActiveSheet.Pictures.Insert(MyFolder & fn) p.Top = i i = i + p.Height + 5 fn = Dir() Loop End Sub