Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I am trying to write a macro which will prompt a user to select multiple images ,from a folder of their choice. The macro then needs to insert the images at eqaul intervals ie C3, C48, C93 and so on an finally resize the images to 19% of their original size. I have found some examples for inserting images into worksheets and have enabled selection of multiple files/images but all of the images or then inserted into the one cell that is selected as the insertion point. At present the insertion cell is selected by the user but I want to make the cells for insertion mandatory. Below is the code thus far. Sub Insert_Pict() Dim Pict As Variant Dim ImgFileFormat As String Dim PictCell As Range Dim Ans As Integer ActiveSheet.Protect False, False, False, False, False ImgFileFormat = "Image Files (*.bmp),others, tif (*.tif),*.tif, jpg (*.jpg),*.jpg" GetPict: Pict = Application.GetOpenFilename(ImgFileFormat, MultiSelect:=True) 'Note you can load in any nearly file format If Not IsArray(Pict) Then Debug.Print "No files selected." Exit Sub End If 'Ans = MsgBox("Open : " & Pict, vbYesNo, "Insert Picture") If Ans = vbNo Then GoTo GetPict 'Now paste to userselected cell GetCell: Set PictCell = Application.InputBox("Select the cell to insert into", Type:=8) If PictCell.Count 1 Then MsgBox "Select ONE cell only": GoTo GetCell PictCell.Select ActiveSheet.Pictures.Insert(Pict).Select End Sub Any help appreciated greatly. MCC. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Is there a way to insert images into unlocked cells | Excel Discussion (Misc queries) | |||
Insert picture, resize to specific width, keeping height proportio | Excel Programming | |||
Insert, position, and resize a picture w/ Macro | Excel Discussion (Misc queries) | |||
in excel paste images to specific cells that can be sorted | Excel Discussion (Misc queries) | |||
Import And Resize Images | Excel Discussion (Misc queries) |