Hello everyone, I am trying to create a Voucher posting system, so i can post accounting transactions easily, but there is something wrong with my coding, can any one help me in this regards, I have never learn about Coding.
Private Sub CommandButton1_Click()
Dim emptyRow As Long
'Make Sheet2 active
Sheet2.Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 2).Value = TextBox1.Value
Cells(emptyRow, 1).Value = TextBox2.Value
Cells(emptyRow, 3).Value = TextBox25.Value
Cells(emptyRow, 4).Value = ComboBox1.Value
Cells(emptyRow, 5).Value = ComboBox2.Value
Cells(emptyRow, 6).Value = TextBox3.Value
Cells(emptyRow, 7).Value = TextBox13.Value
Sheet1.Activate
Unload Me
End Sub
Private Sub CommandButton1_Click()
Dim emptyRow As Long
'Make Sheet2 active
Sheet2.Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 2).Value = TextBox1.Value
Cells(emptyRow, 1).Value = TextBox2.Value
Cells(emptyRow, 3).Value = TextBox25.Value
Cells(emptyRow, 4).Value = ComboBox1.Value
Cells(emptyRow, 5).Value = ComboBox2.Value
Cells(emptyRow, 6).Value = TextBox3.Value
Cells(emptyRow, 7).Value = TextBox13.Value
Sheet1.Activate
Unload Me
End Sub