[COLOR=#222222][FONT=Verdana]Sub Testt()[/FONT][/COLOR]
Const c As String = "9999-0800"
Dim s As String
Dim v As Variant
s = Replace(c, "-", "#-#", 1)
v = Split(s, "#-#")
MsgBox Left(v(1), 1)
End Sub
Are those quote marks in you number like you show or is your number 9999-0800?Hi All,
I am trying to display leading zeros after a hyphen.
for example 9999-"0"800.
The zero inside the " " is the issue. I can't seem to find a format to get this zero to be displayed can someone please assist.
Sub Test()
Dim t, s As String
t = Split(ActiveCell, "-")
t(1) = Format(t(1), "0000")
ActiveCell = Join(t, "-")
End Sub
Try the formula like this...Hi All,
thank you for your replies!
So the formulas used are these: =SOURCE!$B2&SOURCE!$D2 this is looking at a separate tab to combine two numbers. that that tab the two numbers look like this:
9831- 0700
but when that is returned in the cell with ( =SOURCE!$B2&SOURCE!$D2 ) they show like: 9831-700...
I can't seem to get a format correct to allow the cell to show the 0