When i have a value like Spade12 and Club1 in a list box, how do i make it so its just 12, or 1?
Thank you i advance
ILMV
Printable View
When i have a value like Spade12 and Club1 in a list box, how do i make it so its just 12, or 1?
Thank you i advance
ILMV
Hi,
Not great but you can use:
Have a good one!VB Code:
Dim CardVal As String CardVal = List1.List(List1.ListIndex) CardVal = Replace(CardVal, "Spade", "") CardVal = Replace(CardVal, "Club", "") CardVal = Replace(CardVal, "Diamond", "") CardVal = Replace(CardVal, "Heart", "")
BK
Bit of tweaking needed but worked like a charm, i thank you.
A tiny detail, but wouldn't
VB Code:
Dim CardVal As String CardVal = Replace(Replace(Replace(Replace(List1.List(List1.ListIndex), "Spade", ""), "Club", ""), "Diamond", ""), "Heart", "")
be quicker?
Hi,
Anguswalker:
No, there wouldn;t be any difference since the replace() is called the same number of times. It is only harder to read on one line. <g> You could always stick some timing code for each method and compare for yourself.
Have a good one!
BK