فورم ادراج بيانات وصور
الفيديو
الصورة
الكود
Dim fpath As String
Private Sub CommandButton1_Click()
Dim x As Integer
Application.FileDialog(msoFileDialogOpen).AllowMultiSelect = False
x = Application.FileDialog(msoFileDialogOpen).Show
If x <> 0 Then
fpath = Application.FileDialog(msoFileDialogOpen).SelectedItems(1)
Image1.Picture = LoadPicture(fpath)
Image1.PictureSizeMode = 1
End If
End Sub
Private Sub CommandButton2_Click()
Dim x As Integer
Dim y As Worksheet
Set y = Sheets("sheet1")
x = y.Range("a" & Rows.Count).End(xlUp).Row
With y
.Cells(x + 1, "a").Value = Te1.Text
.Cells(x + 1, "b").Value = Te2.Text
.Cells(x + 1, "c").Value = Te3.Text
End With
Dim i As String
i = Te1.Text
FileCopy fpath, "D:\picture\" & i & ".jpg"
Me.Te1.Text = ""
Te1.Text = ""
Te2.Text = ""
Te3.Text = ""
End Sub
Private Sub UserForm_Click()
End Sub