Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Userform text box query??

I posted a reply earlier on similar problem.
Not sure if it's what you are looking for but have pasted
below my last response:

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
TextBox1.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


-----Original Message-----
I've designed a user form with a multipage on it and

managed to to get it to
calculate totals thanks to Tom Ogilvy's advice recently

but what i'm trying
to do now is put the users text box values in particular

cell on the
spreadsheet.
I thought i have worked it out but i can't remember

where i read an example
so i've just got a permanent mental block

If anyone can help it'd be most appreciated
Also is there any good websites that are good for

beginners of VB ??
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Userform text box query?? Tom Ogilvy Excel Programming 0 September 22nd 04 03:05 PM
Entering Query Parameters by UserForm David Excel Programming 2 April 29th 04 09:21 AM
Query on Control Source in Userform Textbox golf4 Excel Programming 4 February 18th 04 02:27 AM
Userform web Data query table alcorjr[_3_] Excel Programming 0 January 29th 04 06:49 PM
Userform and Text Box Jamie[_6_] Excel Programming 5 December 16th 03 04:44 PM


All times are GMT +1. The time now is 06:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"