Dear All,
I have an excel sheet with two coloumns: A & B. In Coloumn B, there are names of jpeg files located in one folder. Now I would like to open each jpteg file given in Coloumn B and save as content of corresponding cell in Coloumn A.
For example; if cell b1 contains a name of jpeg file " photo B1". In Cell A1, there is a text "Photo A1". I would like to open "photo B1" and save it as "Photo A1". Using the code below, I am able to open each jpeg using name given in Coloumn B. But I could not manage to save each file as name given in Coloumn A.
ActiveWorkbook.Sheets("Jan 2015").Activate
'Checking for last line
For CellNr = ActiveCell.Row + 1 To iFinalRow
' file should be sved as name given in coloumn A
mpic = ThisWorkbook.Sheets("Jan 2015").Range("a" & CellNr).Value
' file name given in coloumn B shoul dbe opened and saved value given in Coloumn B
cflag = ThisWorkbook.Sheets("Jan 2015").Range("b" & CellNr).Value
' this is working and opening photos name given in Coloumn B.
Shell "mspaint.exe C:\p\" & cflag & ""
' here need to acode to save the file
Next CellNr
Thanks and best regards
I have an excel sheet with two coloumns: A & B. In Coloumn B, there are names of jpeg files located in one folder. Now I would like to open each jpteg file given in Coloumn B and save as content of corresponding cell in Coloumn A.
For example; if cell b1 contains a name of jpeg file " photo B1". In Cell A1, there is a text "Photo A1". I would like to open "photo B1" and save it as "Photo A1". Using the code below, I am able to open each jpeg using name given in Coloumn B. But I could not manage to save each file as name given in Coloumn A.
ActiveWorkbook.Sheets("Jan 2015").Activate
'Checking for last line
For CellNr = ActiveCell.Row + 1 To iFinalRow
' file should be sved as name given in coloumn A
mpic = ThisWorkbook.Sheets("Jan 2015").Range("a" & CellNr).Value
' file name given in coloumn B shoul dbe opened and saved value given in Coloumn B
cflag = ThisWorkbook.Sheets("Jan 2015").Range("b" & CellNr).Value
' this is working and opening photos name given in Coloumn B.
Shell "mspaint.exe C:\p\" & cflag & ""
' here need to acode to save the file
Next CellNr
Thanks and best regards