LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Adding a Leter to a Numerical Value on Exit

Private Sub TextBox1_Change()
TextBox1.MaxLength = "4"
If IsNumeric(TextBox1) = True Then TextBox1 = UCase(TextBox1) Else TextBox1
= ""
End Sub

The above code i am using to ensure only a 4 digit numerical value is placed
in the textbox.
I actually want on EXIT only that value entered, but with a "A" before it.
Like A4587 etc.

I tried using :
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Textbox1.MaxLength="5"
Textbox1.value = "A"+Textbox1.value
End Sub

But it clears the Textbox value

Is there a way around this?


 
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
Count occurance of a leter in a text string justaman Excel Worksheet Functions 3 October 11th 08 04:51 AM
Giving letters a numerical value, then adding the total. Richard in Stockholm Excel Discussion (Misc queries) 17 April 9th 08 05:01 PM
Adding up non numerical values Wooster New Users to Excel 3 September 23rd 07 01:03 AM
Adding numerical values based on multiple values in another column Kazmaniac Excel Worksheet Functions 6 April 4th 07 08:53 PM
Adding numbers to an incomplete numerical list hana Excel Discussion (Misc queries) 17 January 11th 07 09:46 PM


All times are GMT +1. The time now is 04:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"