lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I have this code part of a form to enter first and last name and the form has 3 buttons: enter, clear, and search. the code below is when user click on "enter". the code makes sure the data will be entered in next empty like. The part i do not understand is this
x = WorksheetFunction.CountA(Range("A:A")) + 1
Can you please explain to me what this code suppose to do?
Thanks you so much.
+++
Private Sub enter_Click()
Dim x As Long
x = WorksheetFunction.CountA(Range("A:A")) + 1
Cells(x, 1) = first.Value
Cells(x, 2) = last.Value
first.Value = ""
last.Value = ""
Me.first.SetFocus
End Sub
I have this code part of a form to enter first and last name and the form has 3 buttons: enter, clear, and search. the code below is when user click on "enter". the code makes sure the data will be entered in next empty like. The part i do not understand is this
x = WorksheetFunction.CountA(Range("A:A")) + 1
Can you please explain to me what this code suppose to do?
Thanks you so much.
+++
Private Sub enter_Click()
Dim x As Long
x = WorksheetFunction.CountA(Range("A:A")) + 1
Cells(x, 1) = first.Value
Cells(x, 2) = last.Value
first.Value = ""
last.Value = ""
Me.first.SetFocus
End Sub