Text format alignment problem
Something like the following should help, basically you
create for each cell a content that is 17 characters long,
just make the cell text alignment to center and then you
are done.
Dim strA As String * 10
Dim strB As String * 6
Dim strC As String
strB = strDataB
strC = Mid(strA, 1, Len(strA) - Len(strDataA)) & strDataA
& "-" & strB
Debug.Print strC
regards
KM
-----Original Message-----
I am making new strings to include a hyphen like this:
strC = strA & "-" & strB
Length strB is not fixed but is limited to maximum 6
characters. Max length strA is not limited but normally
would not exceed 10.
I would like to align my new strings in cells so that the
hyphens are vertically aligned, ideally if possible from
the right, sort of akin to decimal alignment.
I would also be interested to do similar say the "-"
aligned into the 10th character position from left.
TIA,
Steve
.
|