Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How do I insert a PictureBox into Excel?
I don't know much about VBA. Is there any way to easily insert a PictureBox
into an Excel worksheet so that a .jpg file can be selected from a directory of .jpg files and loaded to the worksheet? Thanks, Evanbron |
#2
|
|||
|
|||
How do I insert a PictureBox into Excel?
Hi,
Just off-hand, You could use a userform with an image control, a list box with a list of the picture locations and a button to insert picture into the image control. If the desired pictured is acceptable, use another button to insert the picture into the worksheet. If you would like me to create this project for you, you can send me the relevant info. See my user stuff at http://www.geocities.com/excelmarksway - Mark PS I just might do it anyhow and post it to my Excel site in a couple of days... "Evanbron" wrote: I don't know much about VBA. Is there any way to easily insert a PictureBox into an Excel worksheet so that a .jpg file can be selected from a directory of .jpg files and loaded to the worksheet? Thanks, Evanbron |
#3
|
|||
|
|||
How do I insert a PictureBox into Excel?
This will place the picture on the sheet at the currently selected cell.
Sub JPeg() Dim flname As Variant flname = Application.GetOpenFilename If flname < False Then If Right(flname, 3) = "jpg" Then ActiveSheet.Pictures.Insert (flname) Else MsgBox "That is not a jpeg file" End If End If End Sub Hope this helps Rowan Evanbron wrote: I don't know much about VBA. Is there any way to easily insert a PictureBox into an Excel worksheet so that a .jpg file can be selected from a directory of .jpg files and loaded to the worksheet? Thanks, Evanbron |
#4
|
|||
|
|||
How do I insert a PictureBox into Excel?
Hi,
Rowan's answer is good. I have implemented the same macro to a userform utility. Here is how it works: Click the Open Folder Picture button to show the Open Dialog Click Cancel when you have found the Folder you want. The Open Dialog does not open any files should you click the OPEN button. The file types have been preset in the Open Dialog. The Folder Location textbox shows your selected Folder of Picture Files. The File Type combobox shows you the type of file types allowed for the image control. The Files in the Current Folder listbox shows the compatible files. Click an item in the listbox to load it into the image control. Insert Picture button inserts the selected picture into the current active worksheet. The Hide Pic Box button allows you to hide the main form so you can get a better view of the inserted picture. A small form is shown at the Top-Left of your screen so you can reload the main form when you are ready. Also, I have resized the picture to approx. 1/3 the original size. Good for large pictures, no good if you import an icon or small picture... You can download it from http://www.geocities.com/excelmarksway 24 October 2005 "Evanbron" wrote: I don't know much about VBA. Is there any way to easily insert a PictureBox into an Excel worksheet so that a .jpg file can be selected from a directory of .jpg files and loaded to the worksheet? Thanks, Evanbron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
MS EXCEL does not let me insert a column | Excel Discussion (Misc queries) | |||
Excel 2002 "Protect Sheet", but Allow "Insert Comments"? | Excel Worksheet Functions | |||
Excel Range Value issue (Excel 97 Vs Excel 2003) | Excel Discussion (Misc queries) | |||
insert field from Word into Excel | Excel Worksheet Functions | |||
Insert Function "FX" on Toolbar in Excel | Excel Discussion (Misc queries) |