Showing posts with label Combobox. Show all posts
Showing posts with label Combobox. Show all posts

Friday, March 20, 2020

Combobox List on Userform - EXCEL VBA



Combobox List      
            Combobox List mengambil data cell di  sebuah sheets
           
Private Sub UserForm_Initialize()
ComboBox1.List = Sheet2.Range("a4:a10").Value
End Sub

Private Sub UserForm_Initialize()
ComboBox4.List = Sheet1.Range("E1:E10").Value
 End Sub

Combobox List Multy 
            Combobox List dari beberapa Combobox menggunakan kode array          

Private Sub UserForm_Initialize()
For Jmlh = 1 To 10
Tanggal = Range("   A" & Jmlh)
Bulan = Range("B" & Jmlh)
 Tahun = Range("C" & Jmlh)
Next Jmlh 
End Sub

Combobox List Transpose      
            Combobox List Transpose artinya mengambil data cell kesamping
          atau  no kolom
           
Private Sub UserForm_Initialize()
ComboBox1.List = Application.Transpose(Sheet1.Range("D5:F5").Value)
End Sub

Combobox Null Value
            Memberi Nilai Kosong Untuk Semua Combobox Mulai Combobox Ke 1
Sampai Combobox Ke 5        

Private Sub CommandButton1_Click()
With UserForm1
For ni = 1 To 3
.Controls("pada combobox " & ni).Text = ""
Next
End sub


Combobox Value  
            Nilai Combobox1 Berasal Dari Nilai  Range("A1") 

Private Sub UserForm_Initialize()
Me.ComboBox1.Value = Sheets("Sheet1").Range("A1").Value
End Sub

Combobox1.List Transpose   
Combobox1.List Add Item Transpose   

Private Sub UserForm_Initialize()
ComboBox1.List = Application.Transpose(ActiveSheet.Range("D5:O5").Value)
End Sub


ComboBox1_Change  
            Value texbox atau data cell diambil dari value Combobox1      

Private Sub ComboBox1_Change()
Me.TextBox1.Text = Me.ComboBox1.Value
End Sub

Private Sub ComboBox1_Change()
Sheets("Sheet1").Range("A1").Value = Me.ComboBox1.Value
End Sub

Private Sub ComboBox1_Change()
Label1.caption  = userform2.ComboBox1.Value
End Sub



Tuesday, March 3, 2020

Form Input pilihan ke tabel baris



Input  ketabel pilihan dengan Combobox1 sebagai kunci pilihan ke table baris

 


Kode input pastekan di CommandButton1

Private Sub CommandButton4_Click()
If ComboBox1.Text = "Tabel1" Then
Dim iRow As Long
Sheets("Sheet1").Activate
iRow = WorksheetFunction.CountA(Range("b3:b10")) + 3
Cells(iRow, 2).Value = TextBox1.Value
Cells(iRow, 3).Value = TextBox2.Value
Cells(iRow, 4).Value = TextBox3.Value
Cells(iRow, 5).Value = TextBox4.Value

ElseIf ComboBox1.Text = "Tabel2" Then
Dim aRow As Long
Sheets("Sheet1").Activate
aRow = WorksheetFunction.CountA(Range("b13:b20")) + 13
Cells(aRow, 2).Value = TextBox1.Value
Cells(aRow, 3).Value = TextBox2.Value
Cells(aRow, 4).Value = TextBox3.Value
Cells(aRow, 5).Value = TextBox4.Value

ElseIf ComboBox1.Text = "Tabel3" Then
Dim bRow As Long
Sheets("Sheet1").Activate
bRow = WorksheetFunction.CountA(Range("b23:b30")) + 23
Cells(bRow, 2).Value = TextBox1.Value
Cells(bRow, 3).Value = TextBox2.Value
Cells(bRow, 4).Value = TextBox3.Value
Cells(bRow, 5).Value = TextBox4.Value
End If
End Sub

Private Sub UserForm_Initialize()
ComboBox1.AddItem "Tabel1"
ComboBox1.AddItem "Tabel2"
ComboBox1.AddItem "Tabel3"
End Sub







APLIKASI GUDANG VERSI EXCEL VBA

Aplikasi Gudang Sederhana silahkan dikembangkan kritik dan saran membangun selalu kami harapkan FROM ENTRI IURAN BULANA...