Hi All,
I am new to Macros and am having an issue trying to insert a jpg in to my workbook. I named my files based on information that I gather in my workbook. I sell steel and it has a Certification that is a jpg. I want to open the file and print it based on the Grade Size and Heat as well as the day I received it. I narrowed down the macro to just the inserting jpg part.
Sub PullCert()
'
'This sub opens cert jpg based on Sheet "Table" Cell "AE6'"
Dim FN As String
FN = Worksheets("Table").Range("AE6").Value
'Here is the value of Cell AE6 - C-20813640 1038-295-02 09-29-22.jpg
'Insert worksheet for picture ("Summary" is another sheet in my workbook)
Sheets("Summary").Select
Sheets.Add
'Open jpg File name, based on value of cell value in Worksheet "Table" cell "AE6"
'I defined FN above using FN =
ActiveSheet.Pictures.Insert("Z:\SCANCERTS\FN").Select
End Sub
For some reason, it will not insert the jpg using the filepath with FN.
If I copy the value in AE6, and paste in where the FN is in the macro above... ("Z:\SCANCERTS\FN").Select
it works. I think the problem lays in naming the FN or in the ("Z:\SCANCERTS\FN").Select command.
I have been trying to figure this out for hours! Can someone help me? Would really appreciate it! I know it is something really easy...but I can't see it!
Thanks,
Randy
I am new to Macros and am having an issue trying to insert a jpg in to my workbook. I named my files based on information that I gather in my workbook. I sell steel and it has a Certification that is a jpg. I want to open the file and print it based on the Grade Size and Heat as well as the day I received it. I narrowed down the macro to just the inserting jpg part.
Sub PullCert()
'
'This sub opens cert jpg based on Sheet "Table" Cell "AE6'"
Dim FN As String
FN = Worksheets("Table").Range("AE6").Value
'Here is the value of Cell AE6 - C-20813640 1038-295-02 09-29-22.jpg
'Insert worksheet for picture ("Summary" is another sheet in my workbook)
Sheets("Summary").Select
Sheets.Add
'Open jpg File name, based on value of cell value in Worksheet "Table" cell "AE6"
'I defined FN above using FN =
ActiveSheet.Pictures.Insert("Z:\SCANCERTS\FN").Select
End Sub
For some reason, it will not insert the jpg using the filepath with FN.
If I copy the value in AE6, and paste in where the FN is in the macro above... ("Z:\SCANCERTS\FN").Select
it works. I think the problem lays in naming the FN or in the ("Z:\SCANCERTS\FN").Select command.
I have been trying to figure this out for hours! Can someone help me? Would really appreciate it! I know it is something really easy...but I can't see it!
Thanks,
Randy