Hi i have userform with the all the data adds to the "VehicleRejected" Sheet from a userform however i have added an code for user to select an image from their drive and now i want userform to add the image against the data on same row.
below it is placed in a image2, whereby user can select the picture;
below code which is in command button will add all the date from userform to sheet call "VehicleRejected"
i want to know if it is possible for image that uploaded on the userform which is in image2 can it be also inserted on to the sheet in column I, J, K , L on same row as the date entered with auto size adjusted.
below it is placed in a image2, whereby user can select the picture;
VBA Code:
Dim strFileName As String
strFileName = Application.GetOpenFilename(filefilter:="Tiff Files(*.tif;*.tiff),*.tif;*.tiff,JPEG Files (*.jpg;*.jpeg;*.jfif;*.jpe),*.jpg;*.jpeg;*.jfif;*.jpe,Bitmap Files(*.bmp),*.bmp", FilterIndex:=2, Title:="Select a File", MultiSelect:=False)
TextBox1 = strFileName 'use to save URL or Link from picture
If strFileName = "False" Then
MsgBox "File Not Selected!"
Else
'load picture to Image control, using LoadPicture property
Me.Image2.Picture = LoadPicture(strFileName)
'after any change vba has to be told to refresh the UserForm for the change to appear
Me.Repaint
'label caption changes after picture is loaded
'Me.Label1.Caption = "Logo loaded"
End If
below code which is in command button will add all the date from userform to sheet call "VehicleRejected"
VBA Code:
sh.Range("A" & n + 1).Value = Format(Now, "dd/mm/yyyy")
sh.Range("A" & n + 1).Value = CDate(Me.TextBox8)
sh.Range("B" & n + 1).Value = Me.TextBox35.Value
sh.Range("C" & n + 1).Value = Me.TextBox9.Value
sh.Range("D" & n + 1).Value = Me.ComboBox3.Value
sh.Range("E" & n + 1).Columns.AutoFit
sh.Range("D" & n + 1).Value = Me.TextBox10.Value
sh.Range("E" & n + 1).Columns.AutoFit
sh.Range("F" & n + 1).Value = Me.TextBox11.Value
sh.Range("F" & n + 1).Columns.AutoFit
sh.Range("G" & n + 1).Value = Me.TextBox12.Value
sh.Range("H" & n + 1).Value = Environ("username")
sh.Range("I" & n + 1).Value = Me.Image2
sh.Range("J" & n + 1).Value = Me.Image3
i want to know if it is possible for image that uploaded on the userform which is in image2 can it be also inserted on to the sheet in column I, J, K , L on same row as the date entered with auto size adjusted.