Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Simulating a Zodiac with a chart | Charts and Charting in Excel | |||
How do I select specific cells to be my tab stops? | Excel Worksheet Functions | |||
same than end(xldown) but stops on hidden cells if not empty | Excel Programming | |||
iValue Stops after 10 cells of data | Excel Programming | |||
Simulating HTML frames inside a Excel application | Excel Programming |