Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 247
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default 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
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
i need to convert blank spaces into zero values Tim Excel Discussion (Misc queries) 12 April 9th 23 12:47 PM
convert excel to text file with no tabs naomi Excel Discussion (Misc queries) 7 January 29th 09 05:16 AM
Convert Tabs to Spaces BEEJAY Excel Worksheet Functions 0 February 27th 07 09:20 PM
Repost--"Ignore spaces and tabs in word search" pikapika13[_26_] Excel Programming 1 August 11th 06 07:49 PM
How do I convert numbers stored as text with spaces to numbers Baffuor Excel Discussion (Misc queries) 1 May 24th 05 07:39 AM


All times are GMT +1. The time now is 01:48 AM.

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"