right now I am using a VBA Macro to dowload pictures from a file of my computer into my excel document.
It is thought to take the reference numbers from cells of Column A and insert the pictures in its respective cell in Column B.
I would like to achieve my Macro to work in more cells. So, that I also have reference numbers in Column C, E, G... and the pictures get inserted in Columns D, F, H... .
How should I change these codes so that they also work in other columns? Some loop, other formulas?
Range("A1").Offset(1,0)
Range("B1").Activate
endRow = Range("A65536").End(xlUp).Row
For rowLoop = 2 To endRow
fileName = Trim(Cells(rowLoop, "A")) & ".png"
If (Dir(folderName & fileName) <> "") Then
ActiveSheet.Shapes.AddPicture folderName & fileName, msoFalse, msoTrue, Cells(rowLoop, "B").Left, Cells(rowLoop, "B").Top, _
Cells(rowLoop, "B").Width, Cells(rowLoop, "B").Height
sThanks in advance for your answers!