‘Menampilkan data baris melalue
combobox
Private
Sub ComboBox1_Change()
Cari = ComboBox1.Value
With Worksheets("Sheet1").Range("B6:B50")
Set c = .Find(Cari, LookIn:=xlValues)
If Not c Is Nothing Then
baris = c.Row
'Menampilkan data "ISIAN "
TextBox1.Value =
Worksheets("Sheet1").Cells(baris, 3).Value
TextBox2.Value =
Worksheets("Sheet1").Cells(baris, 4).Value
Else
MsgBox "nama belum tercantum"
End If
End With
End Sub
Kode input untuk mengedit data baris
pilihan
Private
Sub CommandButton1_Click()
Data = ComboBox1.Value
With
Worksheets("Sheet1").Range("B6:B58")
Set c = .Find(Data, LookIn:=xlValues)
If Not c Is Nothing Then
baris = c.Row
Worksheets("Sheet1").Cells(baris,
3).Value = TextBox1.Value
Worksheets("Sheet1").Cells(baris,
4).Value = TextBox2.Value
End If
End With
TextBox1.Value = ""
TextBox2.Value = ""
ComboBox1.SetFocus
End Sub
No comments:
Post a Comment