Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Simulating tab stops in Excel cells

My VBA is Microsoft Visual Basic 6.3, from Excel 2003 (11.6535.6360) SP1
from XP Professional Version 2002 SP3.

Google groups tells me cells do not sensibly display tab characters.
I have some cells where each cell contains a small set of information.
I want vertical alignment of such information.
An example of such data is:
29 Mar 09 29 Mar 09 Central Liverpool Street to Leytonstone
04 Apr 09 05 Apr 09 Hammersmith & City Edgware Road to Hammersmith.

If I use a fixed pitch font, such as Courier New, I can do something
like Left(LineName & Spaces, Len("Hammersmith & City")) to pad the third
pseudo-column to a fixed width.
I am actually using Tahoma, which is a proportional font; that technique
fails to deliver the desired result for proportional fonts.

I have a small number of distinct values for the third column;
I could roughly bludgeon something by padding from an array of spaces;
I am looking for something more elegant.

I have looked for terms like format and align in help, without success.

(Solutions using multiple columns do not fit my criteria. ;( )
(This posting will be distorted, if read in a proportional font ;)
--
Walter Briscoe
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Simulating tab stops in Excel cells

(Solutions using multiple columns do not fit my criteria. ;( )

I can only suggest you modify your self imposed constraints. Looks like you
have 4 or 5 fields so why not dump your data accordingly, Excel is good for
things like this!

Date1, Date2, Route, From, To

You can always "Join" your data for display elsewhere in Excel, say in a
Textbox which does accept tabs, or for export. Programmatically include a
vbTab or manually in a textbox Ctrl-tab.

The other difficulty you will have is knowing how many tabs to insert, so
you may still require some way of determining the overall length of the left
portion. Briefly, in Excel there are two ways to get the length of even
mixed sized fonts:
- Temporarily place the text in a cell on a dummy sheet and Autosize the
column.
- Similar approach with an Autosize textbox (lot more code but more
accurate).

Regards,
Peter T


"Walter Briscoe" wrote in message
...
My VBA is Microsoft Visual Basic 6.3, from Excel 2003 (11.6535.6360) SP1
from XP Professional Version 2002 SP3.

Google groups tells me cells do not sensibly display tab characters.
I have some cells where each cell contains a small set of information.
I want vertical alignment of such information.
An example of such data is:
29 Mar 09 29 Mar 09 Central Liverpool Street to Leytonstone
04 Apr 09 05 Apr 09 Hammersmith & City Edgware Road to Hammersmith.

If I use a fixed pitch font, such as Courier New, I can do something
like Left(LineName & Spaces, Len("Hammersmith & City")) to pad the third
pseudo-column to a fixed width.
I am actually using Tahoma, which is a proportional font; that technique
fails to deliver the desired result for proportional fonts.

I have a small number of distinct values for the third column;
I could roughly bludgeon something by padding from an array of spaces;
I am looking for something more elegant.

I have looked for terms like format and align in help, without success.

(Solutions using multiple columns do not fit my criteria. ;( )
(This posting will be distorted, if read in a proportional font ;)
--
Walter Briscoe



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simulating a Zodiac with a chart gtslabs Charts and Charting in Excel 2 March 16th 09 07:16 PM
How do I select specific cells to be my tab stops? Tab Stops In Excel (JTurke) Excel Worksheet Functions 2 October 21st 08 05:58 AM
same than end(xldown) but stops on hidden cells if not empty Fil Excel Programming 2 November 7th 07 10:13 PM
iValue Stops after 10 cells of data David Excel Programming 1 June 27th 05 07:25 PM
Simulating HTML frames inside a Excel application Matt Jensen Excel Programming 5 December 1st 04 03:15 PM


All times are GMT +1. The time now is 12:56 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"