title: Excel VBA: end user select image on computer and submit on user form
body: <p>I have a userform with a bunch of textboxes. End user inputs test data into form and after clicking "Submit" button, this info is saved to an excel sheet. I am wondering how to make it possible for user to input images from their computer into the form.</p>
  
  <p>Requirements: End user be able to select an image from their computer and click submit on the form to have it inserted into an excel sheet. </p>
  
  <pre><code>Private Sub CommandButton3_Click()
      Dim image As FileDialog 
      Set image = Application.FileDialog(msoFileDialogFilePicker) 
      Dim vrtSelectedPicture As Variant 
      With image 
          If .Show = -1 Then
          For Each vrtSelectedPicture In .SelectedItems                 
              'Show path in textbox
              TextBox71.Text = .SelectedItems(1)      
          Next vrtSelectedPicture
          'The user pressed Cancel.
          Else
          End If
      End With
      'Set the object variable to Nothing
      Set image = Nothing
  End Sub
  </code></pre>