VBA Excel

ANWAR78

New Member
Joined
Jun 29, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
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.
1656477946044.png


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
1656478048874.png
 
Oops, didn't see that at the bottom of the post, but IMO telling people to use On Error Resume Next in that manner is a very bad idea.
That is an investigation method not the solution
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,214,657
Messages
6,120,764
Members
448,991
Latest member
Hanakoro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top