Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Userform question #1

Status
Not open for further replies.

Matrrix

Programmer
Nov 6, 2002
8
CA
Okay question #1

I'm a newbie at this but I learn fast.

I"ve created a userform I want it set up like a database form so i can enter records of info into a spreadsheet. My question is How can I link my text boxes to a spreadsheet.

I hope i'm clear enough
 
Matrix

You can do this in the following way. Assming that your form name is userform1 and the texbox is textbox1, you can link the cells in the worksheet to the textbox value as

Activeworkbook.sheets(1).cells(1,1).value = userform1.textbox1.value

Hope this helps!!!

Ram P
 
I'm already able to that, but I do appreciate the help.

I would like the userform to behave as follows.

Enter name , address, phone number to sheet1!A1

Then move to the next available cell such as A2.

Basically I want the userform I designed to be have like the form option in excel it self.

Thanks again for your assistance.
 
Not sure if i follow your requirements, but are you wanting the form to update the spreadsheet and move you to the next field?
In that case, you'll need to use the exit event. If the user presses return, uses tab or the mouse to move to another field, this event is called. So put the cell = textbox code into that event. It should tab automatically to the next field.
Double click your text box in design mode and select the event exit. Type in the:
Activeworkbook.sheets(1).cells(1,1).value = userform1.textbox1.value
provide by lambuhere and robert's your father's brother.

This would be a lot easier with control arrays by the way. Anyone know how to dupe them in VBA.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top