Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert tabs to spaces
Greetings:
Using Excel 2003, SP2 Am using the following to create text that will be used in another program. Column 'C' has extensive indentations that greatly help the readability of the text. This is lost when the following function is used. Looking for a way to keep the indenting look, when in Text, by replacing the indents with spaces. My inititial test indicates that spaces will "stay", when converting to text - The "space" created by tabs, disappears. =LEFT(TEXT(D1,".")&REPT(" ",11),11)&LEFT(TEXT(E1,".")&REPT(" ",6),6)&C1 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Convert tabs to spaces
If I understand you correctly....
AFAIK, you would need a UDF, to check the .IndentLevel of the cell in question, then scale that by the number of spaces per indent. Something like: =LEFT(TEXT(D1,".")&REPT(" ",11),11)&LEFT(TEXT(E1,".")& REPT(" ",GetIndent(C1)*4) & C1 '<In a normal Module Public Function GetIndent(WhichCell As Range) As Long GetIndent = WhichCell.IndentLevel End Function '</In a normal Module However, if you change the IndentLevel, the formula will not update, as a ..Calculate event does not occur on formatting changes NickHK "BEEJAY" wrote in message ... Greetings: Using Excel 2003, SP2 Am using the following to create text that will be used in another program. Column 'C' has extensive indentations that greatly help the readability of the text. This is lost when the following function is used. Looking for a way to keep the indenting look, when in Text, by replacing the indents with spaces. My inititial test indicates that spaces will "stay", when converting to text - The "space" created by tabs, disappears. =LEFT(TEXT(D1,".")&REPT(" ",11),11)&LEFT(TEXT(E1,".")&REPT(" ",6),6)&C1 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
i need to convert blank spaces into zero values | Excel Discussion (Misc queries) | |||
convert excel to text file with no tabs | Excel Discussion (Misc queries) | |||
Convert Tabs to Spaces | Excel Worksheet Functions | |||
Repost--"Ignore spaces and tabs in word search" | Excel Programming | |||
How do I convert numbers stored as text with spaces to numbers | Excel Discussion (Misc queries) |