Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data validation within a userform


HELP!! Doing A Level ICT finished my project, just adding
the final touches i.e validation.

I have data entry in a userform via textboxes and comboboxes. I need to
validate these under specific criterias. How do I go about doing this?

Any help greatly appreciated.

Thanks
Kate


--
kjenner7
------------------------------------------------------------------------
kjenner7's Profile: http://www.excelforum.com/member.php...o&userid=32216
View this thread: http://www.excelforum.com/showthread...hreadid=519656

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Data validation within a userform

Kate,
Can you give example(s) of validation(s) required as there are a
number of ways of doing these e.g IF ..THEN .. ELSE, CASE ...

"kjenner7" wrote:


HELP!! Doing A Level ICT finished my project, just adding
the final touches i.e validation.

I have data entry in a userform via textboxes and comboboxes. I need to
validate these under specific criterias. How do I go about doing this?

Any help greatly appreciated.

Thanks
Kate


--
kjenner7
------------------------------------------------------------------------
kjenner7's Profile: http://www.excelforum.com/member.php...o&userid=32216
View this thread: http://www.excelforum.com/showthread...hreadid=519656


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data validation within a userform


Its things like only allowing the user to enter a number with no mor
than 2 decimal places. I think the code for VBA is something like:

a = Format(TextBox1.Value, "#,###.00")

but that doesn't seem to be working.
I had some other validation issues aswell but i've been able to wor
those out now, just having trouble with this decimal one and also s
that they can only enter numbers not text

--
kjenner
-----------------------------------------------------------------------
kjenner7's Profile: http://www.excelforum.com/member.php...fo&userid=3221
View this thread: http://www.excelforum.com/showthread.php?threadid=51965

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Data validation within a userform

You want to use the change action of the combo box/text box then use
something like this to check the value entered.

I would not try to force the user to 2 decimals, but instead round
whatever they enter to two decimals.

Private Sub ComboBox1_Change()
'check that is a number
If Not IsNumeric(Me.Value) Then
MsgBox "Must be a number"
'check for decimal count
Else
Me.Value = Round(Me.Value, 2)
End If
End Sub

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Data validation within a userform


:) Yep, thanks for the help i've sorted it all out now. Cheers.
Kate


--
kjenner7
------------------------------------------------------------------------
kjenner7's Profile: http://www.excelforum.com/member.php...o&userid=32216
View this thread: http://www.excelforum.com/showthread...hreadid=519656

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: listbox and controls' data entry validation sebastienm Excel Programming 2 September 15th 05 02:02 PM
Data Validation If statement moved to userform thom hoyle Excel Programming 5 May 12th 05 08:04 PM
Data Validation Cell - Move to UserForm thom hoyle Excel Worksheet Functions 0 April 28th 05 12:23 AM
Using a Userform instead of Data Validation Knut Dahl Excel Programming 2 April 10th 05 11:02 AM
Userform with validation... Mark \(InWales\)[_8_] Excel Programming 3 October 26th 04 07:20 AM


All times are GMT +1. The time now is 06:53 PM.

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"