Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Why does editing a formula cause cell to reformat to text? | Excel Discussion (Misc queries) | |||
Editing text copied into a cell by a UserForm | Excel Programming | |||
Why does the cell I'm editing put the text on the right side? | Excel Discussion (Misc queries) | |||
Possible too - ADD Text While editing a cell | Excel Programming | |||
Editing text within a cell | Excel Programming |