Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pam Pam is offline
external usenet poster
 
Posts: 128
Default calculate vba userform type mismatch when decimal is entered

I have a vba userform that I want to calculate fields.
I have a quantity, unit price, and want the calculation to be in the
extended price field.
I'm using the following code, and it works great, as long as you use a
number not starting with a decimal. ie.. I can input 1 x 1.50 and it works,
or I can enter 1 x 0.50 and it works, but if I enter 1 x .5 it errors out as
a type mismatch.
What am I doing wrong?
Thank you

Private Sub Txtitemunit1_Change()
If Me.TxtItemQty1.Value < "" Then
Me.TxtItemExt1.Value = Me.TxtItemUnit1.Value * Me.TxtItemQty1.Value
End If
End Sub
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
How to type format time in decimal format & calculate Cheyenne Excel Discussion (Misc queries) 1 February 12th 09 11:54 PM
Type Mismatch: array or user defined type expected ExcelMonkey Excel Programming 4 July 6th 06 03:40 PM
How to calculate time in 1/100 decimal while it is entered 1/60 zyberdoc Excel Programming 4 March 16th 06 04:23 PM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM
Passing Userform Listbox to sub causes type-mismatch error Kleev Excel Programming 2 October 19th 05 08:46 PM


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