I have a spreadsheet that I created a UserForm for using VBE. My problem is I have not learned how to write the codes yet. I have two text fields and a next and close button.
What I would like to have happen is this. I want the text from field 1 entered into cell A4 and the text from field 2 entered into cell B4. When I click the next button I want it to start populating cells A5 and B5 and so on. Basically I want to capture name and ID and have it go to the next line either automatically or when i click next.
Thanks in advance,
iThinkDeeply
In the NEXT button code, something like this:
Private Sub Next_Click() With ActiveSheet NR = .Range("A" & Rows.Count).End(xlUp).Row + 1 .Range("A" & NR).Value = TextBox1.Value .Range("B" & NR).Value = TextBox2.Value TextBox1.Value = "" TextBox2.Value = "" End With End Sub
Personally, I'd name my button ENTER or AddData or something like that.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
“None of us is as good as all of us” - Ray Kroc
“Actually, I *am* a rocket scientist.” - JB (little ones count!)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks