Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hey all.. I need help.. I think I am on the right track but I confused
myself.. I have a textbox 8 that has a number that is formatted like this... JA00000 I want to, if OptionButton1 is selected, to auto increase the value of Textbox8 by one, saving the time of haveing to enter the number in when Im entering a lot of data.. here is what I have so far... If OptionButton1.Value = True Then 'gets current Textbox8 value, assigns it a variable NumInc = TextBox8.Value 'takes the right 5 digits of the value of textbox8 Number = Right(NumInc, 5) 'makes a newnumber by taking the 5 digits, adding 1 NewNumber = Number + 1 'for my t/s only :) MsgBox (NewNumber) End If Now this does gleen the numbers, except the zeros.. how do I take this number and add it back into the format JA00000 ?? If I ran it and I was entering item # JA00085, the troubleshooting MsgBox would tell me the value of NewNumber is 86... I need it to put in TextBox8, JA00086 ... and eventally, it will be moving over to 100's etc.. so I can't set it to put in JA000 + NewNumber ... It cant be hardcoded, it has to take up all the digits into account, but if there is only 2 digits in the number, I need the numbers preceding it to be zeros.. Any ideas ?? Thanks for your Help!!! Joe Derr |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Increment invoice number | Excel Worksheet Functions | |||
Auto Increment Number | Excel Discussion (Misc queries) | |||
increment version number | Excel Discussion (Misc queries) | |||
How do I Increment a particular woksheet number? | Excel Worksheet Functions | |||
Increment an Invoice number | Excel Worksheet Functions |