ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   question on horizontal tab (https://www.excelbanter.com/excel-programming/381087-question-horizontal-tab.html)

wcc[_3_]

question on horizontal tab
 
Hello,

When putting a string into a clipboard (which can be later pasted into
Excel), what do I need to use to represent the horizontal tab? I
thought "\t" is the answer, but it doesn't work. It shows as a square
box instead of splitting data into multiple columns. Thank you!

--
wcc


Bernard Liengme

question on horizontal tab
 
Try formatting the cell: Format | Cells -Alignment and check the "Wrap
Text" box
I assume the "/t" is correctly inserting a CHAR(10)
best wishes
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"wcc" wrote in message
ups.com...
Hello,

When putting a string into a clipboard (which can be later pasted into
Excel), what do I need to use to represent the horizontal tab? I
thought "\t" is the answer, but it doesn't work. It shows as a square
box instead of splitting data into multiple columns. Thank you!

--
wcc




wcc[_3_]

question on horizontal tab
 
Thanks Bernard. I'm afraid I didn't explain my question clearly.
Suppose I want to paste string "1" & "2" into cell A1 and B1. If I have
"1\t2" in the clipboard, in cell A1 if I press Ctrl+V to paste, instead
of putting "1" in cell A1 and "2" in cell B1, Excel will put a string
"1 2" into cell A1, between "1" and "2" is a rectangular box. I think
CHAR(10) is "\n" which is for new-line, not a tab.

Btw, on the other hand, if I have "1\r2" or "1\n2" in clipboard, Excel
will place "1" and "2" in two adjacent cells, on above the other.

Thanks.

--
wcc


Bernard Liengme

question on horizontal tab
 
Do you know about Data | Text to Columns ?
--
Bernard V Liengme
www.stfx.ca/people/bliengme
remove caps from email

"wcc" wrote in message
ps.com...
Thanks Bernard. I'm afraid I didn't explain my question clearly.
Suppose I want to paste string "1" & "2" into cell A1 and B1. If I have
"1\t2" in the clipboard, in cell A1 if I press Ctrl+V to paste, instead
of putting "1" in cell A1 and "2" in cell B1, Excel will put a string
"1 2" into cell A1, between "1" and "2" is a rectangular box. I think
CHAR(10) is "\n" which is for new-line, not a tab.

Btw, on the other hand, if I have "1\r2" or "1\n2" in clipboard, Excel
will place "1" and "2" in two adjacent cells, on above the other.

Thanks.

--
wcc




wcc[_3_]

question on horizontal tab
 
I didn't know about Text to Columns, but it works for my purpose. Thank
you Bernard.

--
wcc


NickHK

question on horizontal tab
 
Not sure how this content is being put in the clipboard, and I assume "1\r2"
relates to RTF...

The clipboard can hold different items simultaneously, but only one of each
format.
If you copy Rich Text Format text, that format will be available, as well as
a text version of the same.
Pasting into another environment that support RTF will take that format, but
into one that does not support RTF (sat NotePad) will paste the text
version.

So if you place the string "1\t2" on the clipboard, it will be as text and
hence unformatted.
(I get the same for "1\r2" and "1\n2" also.)

So depends if these values are put on the clipboard as RTF or text.

NickHK
By the way you can use the clipbrd.exe to view the values on the clipboard
and save the clipboard to view in a text editor, to what you actually have.


"wcc" wrote in message
ps.com...
Thanks Bernard. I'm afraid I didn't explain my question clearly.
Suppose I want to paste string "1" & "2" into cell A1 and B1. If I have
"1\t2" in the clipboard, in cell A1 if I press Ctrl+V to paste, instead
of putting "1" in cell A1 and "2" in cell B1, Excel will put a string
"1 2" into cell A1, between "1" and "2" is a rectangular box. I think
CHAR(10) is "\n" which is for new-line, not a tab.

Btw, on the other hand, if I have "1\r2" or "1\n2" in clipboard, Excel
will place "1" and "2" in two adjacent cells, on above the other.

Thanks.

--
wcc





All times are GMT +1. The time now is 10:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com