Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
I have a userform where users enter infomation into a textbox, upon hitting an enter button my code puts the infomation into the spreadsheet. ActiveCell.Offset(0, 0).Value = UserForm1.TextBox1.Value My problem is some of the infomation must be a number i.e. a quantity. How can i change the code to accept only a number in certain textboxes? Thanks in advance |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You have to test if the number is numeric and if it is not then have the text
box re-open with an error message Use isnumeric do if not isnumeric(UserForm1.TextBox1.Value) then enter error message end if while not isnumeric(UserForm1.TextBox1.Value) ActiveCell.Offset(0, 0).Value = UserForm1.TextBox1.Value "Adam" wrote: Hi I have a userform where users enter infomation into a textbox, upon hitting an enter button my code puts the infomation into the spreadsheet. ActiveCell.Offset(0, 0).Value = UserForm1.TextBox1.Value My problem is some of the infomation must be a number i.e. a quantity. How can i change the code to accept only a number in certain textboxes? Thanks in advance |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use the textbox's change event along with isnumeric function to determine if
what is being entered is valid... -- HTH... Jim Thomlinson "Adam" wrote: Hi I have a userform where users enter infomation into a textbox, upon hitting an enter button my code puts the infomation into the spreadsheet. ActiveCell.Offset(0, 0).Value = UserForm1.TextBox1.Value My problem is some of the infomation must be a number i.e. a quantity. How can i change the code to accept only a number in certain textboxes? Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Looping through TextBox's | Excel Programming | |||
Looping through TextBox's | Excel Programming | |||
Tabbing between textbox's | Excel Programming | |||
Digits in textbox's | Excel Discussion (Misc queries) | |||
Digits in textbox's | Excel Programming |