ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro to display (https://www.excelbanter.com/excel-discussion-misc-queries/263870-macro-display.html)

puiuluipui

Macro to display
 
Hi, i need to write in A1 a number and a macro to search in a folder for a
picture with this name and then to display this picture.
If i write 22942 and run the macro, then the macro to search in a folder and
to find and display in curent sheet, the picture 22942.
Can this be done?
Thanks!

Gord Dibben

Macro to display
 
Sub Insert_Pic()
ActiveSheet.Pictures.Insert ( _
"C:\Documents and Settings\username\My Documents\My Pictures\" & _
Range("A1") & ".jpg")
End Sub

Adjust path and filetype to suit


Gord Dibben MS Excel MVP

On Sun, 16 May 2010 03:19:01 -0700, puiuluipui
wrote:

Hi, i need to write in A1 a number and a macro to search in a folder for a
picture with this name and then to display this picture.
If i write 22942 and run the macro, then the macro to search in a folder and
to find and display in curent sheet, the picture 22942.
Can this be done?
Thanks!



puiuluipui

Macro to display
 
Thanks!

"Gord Dibben" a scris:

Sub Insert_Pic()
ActiveSheet.Pictures.Insert ( _
"C:\Documents and Settings\username\My Documents\My Pictures\" & _
Range("A1") & ".jpg")
End Sub

Adjust path and filetype to suit


Gord Dibben MS Excel MVP

On Sun, 16 May 2010 03:19:01 -0700, puiuluipui
wrote:

Hi, i need to write in A1 a number and a macro to search in a folder for a
picture with this name and then to display this picture.
If i write 22942 and run the macro, then the macro to search in a folder and
to find and display in curent sheet, the picture 22942.
Can this be done?
Thanks!


.



All times are GMT +1. The time now is 01:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com