Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Editing text in cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Editing text in cell

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 81
Default Editing text in cell

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   Report Post  
Posted to microsoft.public.excel.programming
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






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
Why does editing a formula cause cell to reformat to text? Jack Greb Excel Discussion (Misc queries) 2 January 25th 08 01:56 AM
Editing text copied into a cell by a UserForm Jack_Feeman Excel Programming 2 May 30th 07 12:50 PM
Why does the cell I'm editing put the text on the right side? Kate Mars Excel Discussion (Misc queries) 1 September 10th 05 12:18 AM
Possible too - ADD Text While editing a cell thom hoyle Excel Programming 3 June 11th 05 06:44 PM
Editing text within a cell David Excel Programming 4 April 23rd 04 02:32 AM


All times are GMT +1. The time now is 08:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"