Hi All
I found this VBA code on the forum which is really helpful, but not really understanding how it works I cant answer my subsidiary question.
The code is
Function InsertCommas(S As String) As String
InsertCommas = Application.Substitute(Replace(StrConv(S, vbUnicode), Chr(0), ","), ",", "", Len(S))
End Function
What Id like to do now is restrict this to only placing commas either immediately before a numeric value or immediately after a text value.
Can this be done?
Thanks
simon
I found this VBA code on the forum which is really helpful, but not really understanding how it works I cant answer my subsidiary question.
The code is
Function InsertCommas(S As String) As String
InsertCommas = Application.Substitute(Replace(StrConv(S, vbUnicode), Chr(0), ","), ",", "", Len(S))
End Function
What Id like to do now is restrict this to only placing commas either immediately before a numeric value or immediately after a text value.
Can this be done?
Thanks
simon