# Return text NOT date format

So... I have this line of code:

If Range("I" & b) > 0 Then
Range("V" & b).Value = Range("H" & b) & "-" & Range("I" & b)  ' saw lu key
Else
Range("V" & b).Value = "0-0"

It it is concatenating together two numbers with a dash between them.  Problem I have is that when the leading number is 1-12 it comes over formatted as a date.  So if the two numbers I am putting together are 12 and 1 the result is "1-Dec" NOT "12-1".  How do I get it to format to 12-1 not a date of 1-Dec??
###### Who is Participating?

Commented:
You can just prefix with an apostrophe:

``````Range("V" & b).Value = "'" & Range("H" & b) & "-" & Range("I" & b)  ' saw lu key
``````

or format the cell as text:

``````With Range("V" & b)
.numberformat = "@"
.Value = Range("H" & b) & "-" & Range("I" & b)  ' saw lu key
end with
``````
0

Finance AnalystCommented:
Change:

Range("V" & b).Value = Range("H" & b) & "-" & Range("I" & b)

to

Range("V" & b).Value = Text(Range("H" & b) & "-" & Range("I" & b),"000-000")
0

Author Commented:
Neither met what I needed, and I ended up going another direction.  However any fresh ideas are always welcome
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.