Column Header Alignment?

P

(PeteCresswell)

I'm setting a column header cell's .Value to a constant:

Const mColHdr_MarketChange As String = "Mkt Value" & vbCrLf & "Change"

And then I'm aligning it right as in:
---------------------------------------
With .Cells(mRowNum_ColHeaders2, curCol)
.Value = mColHdr_MarketChange
.IndentLevel = 1
.VerticalAlignment = xlBottom
.HorizontalAlignment = xlRight
End With
---------------------------------------

But what I'm gettin is (you'll need a
fixed-space font like Courier to see it)
-------------
Mkt Value
Change
-------------

Note that the last letters are not aligned.
The "e" of "Change" sticks out to the right.

Anybody see what I'm doing wrong?

Is the .IndentLevel doing something unexpected?
I'd expect it to indent all lines and not just the first one.

I need the .IndentLevel bc I'm putting a little graphic in each
column and don't want the header to clobber it.
 
T

Tom Ogilvy

change you constant to this

Const mColHdr_MarketChange As String = "Mkt Value" & vbLf & "Change"

you are putting in an extra character and thus causing your problem.
 
P

(PeteCresswell)

Per Tom Ogilvy:
change you constant to this

Const mColHdr_MarketChange As String = "Mkt Value" & vbLf & "Change"

you are putting in an extra character and thus causing your problem.

Got it.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top