Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Dude, That's pretty much what I needed. Unfortunately, there are a couple o cases where I need to limit what's being input by using comboboxes. Ho would I fit those into it? dude Wrote: I assume that you are trying to add data from your form in to database format? If so, you could just simply read the user input from the form into a simple array and then add data to your table this way. something like this may work: Private Sub CommandButton1_Click() ReDim mydata(4) For na = 0 To 3 mydata(na) = Controls(na).Text Controls(na).Text = "" Next Dim NewRecordRng As Object Set NewRecordRng = Worksheets("sheet1").Cells(2, 1).CurrentRegion 'Put new values into worksheet just below those rows. newrow = NewRecordRng.Rows.Count + 1 With NewRecordRng For na = 0 To 3 .Cells(newrow, na + 1).Value = mydata(na) Next End With TextBox2.SetFocus End Sub I have only shown 4 textboxes but you can modify to meet your needs. To see if this works for you. create a form & add 4 textboxes then add a button(in that order) Double click the button and past above code. You need a sheet named sheet1. Run the form & enter data. It should add data to sheet1 & clear textboxes for next entry. further entry should be placed on next line. Hope helpful . -- madblok ----------------------------------------------------------------------- madbloke's Profile: http://www.excelforum.com/member.php...fo&userid=1442 View this thread: http://www.excelforum.com/showthread.php?threadid=26092 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
NEED A MACRO CODE TO USE IN A USERFORM | Excel Discussion (Misc queries) | |||
UserForm code help needed. | Excel Programming | |||
Userform Formula Help Needed | Excel Programming | |||
VBA code for Userform | Excel Programming | |||
A pointer or two needed using userform | Excel Programming |