LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to insert multiple images at specific cells and resize all i

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to insert images into unlocked cells martin Excel Discussion (Misc queries) 1 December 15th 08 10:51 PM
Insert picture, resize to specific width, keeping height proportio justme Excel Programming 7 October 22nd 07 07:56 PM
Insert, position, and resize a picture w/ Macro John Excel Discussion (Misc queries) 1 July 10th 07 07:21 PM
in excel paste images to specific cells that can be sorted tss Excel Discussion (Misc queries) 0 April 26th 06 02:12 AM
Import And Resize Images 2eXtreme Excel Discussion (Misc queries) 6 February 5th 06 03:47 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"