PC Review


Reply
Thread Tools Rate Thread

Column Header Alignment?

 
 
(PeteCresswell)
Guest
Posts: n/a
 
      22nd Mar 2007
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.


--
PeteCresswell
 
Reply With Quote
 
 
 
 
(PeteCresswell)
Guest
Posts: n/a
 
      22nd Mar 2007
Per (PeteCresswell):
>Const mColHdr_MarketChange As String = "Mkt Value" & vbCrLf & "Change"


>Anybody see what I'm doing wrong?


Got it!

It's the CR being rendered as a space-taking character.

vbCrLf sb vbLf
--
PeteCresswell
 
Reply With Quote
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      22nd Mar 2007
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.

--
Regards,
Tom Ogilvy


"(PeteCresswell)" wrote:

> 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.
>
>
> --
> PeteCresswell
>

 
Reply With Quote
 
(PeteCresswell)
Guest
Posts: n/a
 
      22nd Mar 2007
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!
--
PeteCresswell
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Controling alignment in header =?Utf-8?B?UGV0ZXIgS2FybHN0csO2bQ==?= Microsoft Excel Programming 6 27th Nov 2007 02:59 AM
Header Alignment =?Utf-8?B?c3ByaW50MjEz?= Microsoft Excel Setup 2 27th Jan 2005 03:11 PM
how do i get to left alignment after the header =?Utf-8?B?Ymx1amVwcmo=?= Microsoft Word New Users 1 7th Oct 2004 12:23 PM
Alignment Listbox Header sapta Microsoft Access Form Coding 1 13th Oct 2003 04:37 AM
DataGrid column header alignment cnu Microsoft C# .NET 0 23rd Sep 2003 03:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:39 AM.