View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Editing text in cell

I see what you mean. The code I posted does insert a TAB character between
the two words. See:

http://www.techonthenet.com/ascii/chart.php

In Word, the TAB character is used to display text aligned to fixed columns.
The same is true for most word processors. In Excel, however, the TAB
character does not have that effect. It is just another character in the
string. It is usually displayed as a small square.

I don't know how to get the "TAB" effect in Excel that is the same as Word.
--
Gary''s Student - gsnu2007d


"donwb" wrote:

Hi
The code you suggest puts the following text:-
"SomewordAnotherword" (with no tab) into the cell,
-which is what I would expect, but with a tab.

What I want to know is how I insert a Tab into the existing text.
at an insertion point of my choosing.

I would still like to know if this can be done using the keyboard.
Don

"Gary''s Student" wrote in message
...
The following sub:

Sub dural()
Set r = ActiveCell
r.Value = "Someword" & Chr(9) & "Anotherword"
End Sub

will get you the desired result of inserting a tab inside text. You don't
need SendKeys to do this.
--
Gary''s Student - gsnu2007d


"donwb" wrote:

Win XP, Excel 2003
Is it possible to Tab the insertion point for text in a cell.
Say I want to type "Someword" then a Tab space then "Anotherword."
Using the Tab key alone or with combinations of Shift, Ctrl and Alt
doesn't
do it.
Strangely though, Alt + RETURN will move the insertion point to the next
line.
If it is not possible with keyboard strokes, can it be done
programmatically?
I have got as far as:-
ActiveSheet.Range("A1").Select
SendKeys "{F2}", True
DoEvents
(to put the cell into the Edit mode, which it does, then)
SendKeys "{Tab}", True
DoEvents
(to tab the insertion point, but it doesn't)
Help please