I need VBA Code to get an image in a image control on a userform to an image control on an excel worksheet when I click the submit button control.
I need VBA Code to get an image in a image control on a userform to an image control on an excel worksheet when I click the submit button control.
What have you got so far?
Remember To Do the Following....
Use [Code].... [/Code] tags when posting code to the thread.
Mark your thread as Solved if satisfied by using the Thread Tools options.
If posting the same issue to another forum please show the link
Here is the code to get the picture loaded to the userform
[VBA]Private Sub Image1_Click()
Dim PictFileName As String
PictFileName = Application.GetOpenFilename
PicPath = PictFileName
If Len(Dir(PicPath)) = 0 Then
MsgBox PicPath & " does not exist."
Else
Me.Image1.Picture = LoadPicture(PicPath)
Me.Repaint
'ActiveWorkbook.Sheets("SO916").
ImgWorkSheet = LoadPicture(PicPath)
End If
End Sub[/VBA]
I also inserted this code on the worksheet itself, changing the name of the image control, and got the same ability to insert a picture on the worksheet.
My goal is I fill out the userform and insert the picture, then I click the submit button, all the information from the form is transferred to the worksheet.
I have all the text to transfer OK, I'm just having problems with the picture.
[VBA]Sheet1.Image1.Picture = LoadPicture(PictFileName)[/VBA]