Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Textbox on user form type mismatch

I have a textbox on a user form that is giving me an error when a
number is entered in. This number is a percent and the code for the
textbox is:

Private Sub TextBox35_AfterUpdate()
If IsNumeric(Me.TextBox35.Value) Then
Me.TextBox35.Value = Format(CDbl(TextBox35) / 100, "0.00%")
End If
End Sub

This works fine only if I enter a whole number(?), meaning, 10, 12, 30,
44 all will work. But if I enter 10.3, then I get the error. Any
thoughts on where I'm going wrong?

There is another button on the form that when clicked will mulitply
textbox1 x textbox35 + textbox1. So the flow is: 1) a value is in
textbox1, 2) I enter in a 'markup', say 10.5 and click the button. The
error comes up at that point, again, only if I use a '.'....in
textbox35.

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
#13 type mismatch error on user form for Dave Peterson Janis Excel Discussion (Misc queries) 5 January 17th 08 07:35 PM
Textbox on user form type mismatch Gimp Excel Programming 5 January 19th 07 07:18 PM
#13 type mismatch error on user form Janis Excel Programming 0 September 4th 06 07:11 PM
Type Mismatch: array or user defined type expected ExcelMonkey Excel Programming 4 July 6th 06 03:40 PM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM


All times are GMT +1. The time now is 05:23 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"