In column B ther are Numbers from 2nd row to Last row. starting from 0001
in between in column B thereare numbers starting with "Z-" and these also respectively starting from 0001 but if i select in combobox "ABC"
I would like to auto increment the number with String "Z-0002 in the textbox when i select combox value as "ABC"
Thanks
NimishK
in between in column B thereare numbers starting with "Z-" and these also respectively starting from 0001 but if i select in combobox "ABC"
I would like to auto increment the number with String "Z-0002 in the textbox when i select combox value as "ABC"
Code:
Private Sub UserForm_Initialize()
With worksheets("Sheet1")
.Columns("B").NumberFormat = "0000"
End with
End Sub
Public Sub Auto_Increment_No()
Dim Var2 as Variant
Dim alpNum as String
If comboName.Text = "ABC" Then
alpNum = "Z-" & Format(Var2 + 1, "0000")
TextNos.Text = alpNum
[B][COLOR=#ff0000] '''''Here TextNos.Text showing Blank No increament Value at all[/COLOR][/B]
Else
TextNos.Text = Format(Var2 + 1, "0000")
[B][COLOR=#ff0000] ''''' Here it shows perfectly without alpNum[/COLOR][/B]
End Sub
Thanks
NimishK
Last edited: