![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
Hi all, My question is After making a userform with textboxes, How to get the data that someone has entered in the textbox, to a cell in a excel spreadsheet. Say I had a textbox named (Test), and whatever the person put in that box,I wanted it to go to Sheet 2 Cell ("A6"). Thx Dan
|
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Mar 2002
Location: Kobe, Japan
Posts: 1,420
|
Hi. How about this...
'Write in UserForm Module Private Sub TEST_AfterUpdate() Sheets("Sheet2").Range("A6").Value = TEST.Text End Sub |
|
|
|
|
|
#3 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
Thank you so much Colo. Sometimes hard to find answers. Have a good evening. Dan
|
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Location: London
Posts: 20
|
following up on this - can anyone tell me how to ensure that the textbox value is numeric and not alphabetic?
|
|
|
|
|
|
#5 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
If I could follow up on my question. I noticed every time I run the userform, It eraces the previous information entered. Any way of keeping the information viewable (when reopening the form), and giving the the User the option of changing the information If req. Thx Dan
|
|
|
|
|
|
#6 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
How about
Private Sub TEST_AfterUpdate() If IsNumeric(Test) Then Sheets("Sheet2").Range("A6").Value = Test.Value Else MsgBox "Numbers only please" Test.SetFocus End If End Sub |
|
|
|
|
|
#7 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
Thanks Again all Many thanks !. Have a good evening. Dan
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|