View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Adam[_18_] Adam[_18_] is offline
external usenet poster
 
Posts: 10
Default Error control dont work!

Hi

I have a userform with a textbox on it.

On loading it picks up a number from a cell on the spreadsheet. I want
a % sign in the textbox with the number, ie 15%. I use the following
code to achieve that.

UserForm6.TextBox5.Value = Format(Sheets("Rate
Table").Range("f4").Value, "###,##0.00""%")

When the user edits the textbox and press Enter the infomation is the
checked to make sure its a number and the entered back into the
spreadsheet. I use the following code to achieve that.

If IsNumeric(UserForm6.TextBox5.Text) & "%" = False Then GoTo
errorhandler:

ActiveCell.Offset(0, 5).Value =
Application.Substitute(UserForm6.TextBox5.Value, "%", "")

My problem is if the textbox is left blank or a letter is entered, it
does not error. Infact i dont think the error code works at all.

Please advise, i have run out of idea's

Thanks