Pastekan kode
berikut pada Combobox1
Private Sub
ComboBox1_Change()
ComboBox1.List =
Sheets("Data").Range("A6:A100").Value
ListBox1.ColumnCount = 4
ListBox1.ColumnWidths = 35 &
";" & 100 & ";" & 100 & ";" &
80
ListBox1.RowSource =
"data"
On Error Resume Next
Dim Filter As
String, Title As String, FileX As String
X.SetFocus
caridata =
Me.ComboBox1.Value
With
Worksheets("DATA").Range("A6:A100")
Set c =
.Find(caridata, LookIn:=xlValues)
If Not c Is Nothing
Then
Baris = c.Row
Me.TextBox1.Value =
Worksheets("DATA").Cells(Baris, 2).Value
Me.TextBox2.Value =
Worksheets("DATA").Cells(Baris, 3).Value
Me.TextBox3.Value =
Worksheets("DATA").Cells(Baris, 4).Value
Me.TextBox4.Value =
Worksheets("DATA").Cells(Baris, 5).Value
Else
ComboBox1 =
""
TextBox1 =
""
TextBox2 =
""
Image1.Picture =
LoadPicture
End If
End With
Application.ScreenUpdating = True
DataFoto =
TextBox1.Value
Files =
ActiveWorkbook.Path & "\FOTO\" & DataFoto &
".jpg"
Image1.Picture =
LoadPicture(Files)
Application.ScreenUpdating = True
'With Sheets("data")
'.OLEObjects("Image1").Object.Picture = Me.Image1.Picture
'End With
End Sub
Pastekan kode
berikut pada Userform
Private Sub
UserForm_Initialize()
ComboBox1.List =
Sheets("Data").Range("A6:A100").Value
ListBox1.ColumnCount = 4
ListBox1.ColumnWidths = 35 &
";" & 100 & ";" & 100 & ";" &
80
ListBox1.RowSource =
"data"
End Sub
No comments:
Post a Comment