Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a user form with a text box. The user enters a rate and a return on
assets figure is calculated. My problem is that when the rate is blank, if the user zeroes it out, an overflow error occurs. I think this is due to the fact that when it's blank a division by zero is performed downstream. I tried to write some code to deal with this but it doesn't seem to work. Any help would be appreciated. Private Sub txtvolsp_Change() If txtvolsp.Text = " " Then spvol = 0.00001 Else spvol = CLng(txtvolsp.Value) End If End Sub -- Paul |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Text format - setting text colour with code | Excel Discussion (Misc queries) | |||
Macro - Fixed text code needs replacing with variable text | Excel Discussion (Misc queries) | |||
Convert a Number Code to a Text Code | Excel Discussion (Misc queries) | |||
Problem with VBA Code? | Excel Programming | |||
Date problem from code to text box to spreadsheet | Excel Programming |