LindaSimpson New Member
Joined: 21 May 2007 Posts: 24 Location: Cleaveland, IH
|
Posted: Tue Jan 06, 2009 4:31 pm Post subject: |
|
|
=JustifyString([CCandPAC] & "." & [ObjectAccount]," ")
Code: | Public Function JustifyString(strIn As String, strChar As String) As String
Dim intTemp As Integer
Dim strTemp As String
For intTemp = 1 To Len(strIn)
strTemp = strTemp & Mid(strIn, intTemp, 1) & strChar
Next
JustifyString = Left(strTemp, Len(strTemp) - Len(strChar))
End Function |
Place the above Function in a VB Module that is not the same name as the Function.
In the second argument of JustifyString, put whatever you want to place between each character in a string:
JustifyString("9238.4396.6055", Space(5))
9 2 3 8 . 4 3 9 6 . 6 0 5 5
JustifyString("9238.4396.6055", " | ")
9 | 2 | 3 | 8 | . | 4 | 3 | 9 | 6 | . | 6 | 0 | 5 | 5
JustifyString("9238.4396.6055", "_^_")
9_^_2_^_3_^_8_^_._^_4_^_3_^_9_^_6_^_._^_6_^_0_^_5_^_5
JustifyString("9238.4396.6055", Chr(5))
9238.4396.6055
________
C20let |
|