ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Pictures in Forms (https://www.excelbanter.com/excel-worksheet-functions/119461-pictures-forms.html)

SusieQ

Pictures in Forms
 
Hi

I'm setting up a form and have unlocked the cells that need input and the
form is running okay including all the picklists etc. But in some of the
cells I require photographs inserting by the users and can't work out how to
format the cell or protection to allow this. Please could someone help?

Corey

Pictures in Forms
 
Sub Insert_Pict()
Dim Pict
Dim ImgFileFormat As String
Dim PictCell As Range
Dim Ans As Integer

ActiveSheet.Protect True, True, True, True, True
ImgFileFormat = "Image Files (*.bmp),others, tif (*.tif),*.tif, jpg
(*.jpg),*.jpg"

GetPict:
Pict = Application.GetOpenFilename(ImgFileFormat)
'Note you can load in any nearly file format
If Pict = False Then End

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



"SusieQ" wrote in message
...
Hi

I'm setting up a form and have unlocked the cells that need input and the
form is running okay including all the picklists etc. But in some of the
cells I require photographs inserting by the users and can't work out how
to
format the cell or protection to allow this. Please could someone help?





All times are GMT +1. The time now is 05:33 PM.

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