Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
WinXP Excel 2003
Is it possible to programmicatically determine the position of the Cursor in a text string in a cell - eg as a count to the Right from the 1st character in the cell? Also, I have a macro which places a Tab code [Chr(9)] in a string. If I then try to manually edit the text (double click the cell), I see that the Cursor has been tabbed ok, but any text I then enter ignores the tab and is placed immediately after the last character in the string. Is there any way to overcome this. donwb |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
First put data in a cell (either with VBA or manually).
Next double-click the cell. If you double-click near the right boundary of the cell, the edit cursor will appear near the end of the data. If you double-click near the left boundary of the cell, the edit cursor will appear near the beginning of the data. You can, from VBA, programmatically enter edit mode in a cell with the edit cursor exactly positioned, but it requires SendKeys (which many prudent people avoid). -- Gary''s Student - gsnu200770 "donbowyer" wrote: WinXP Excel 2003 Is it possible to programmicatically determine the position of the Cursor in a text string in a cell - eg as a count to the Right from the 1st character in the cell? Also, I have a macro which places a Tab code [Chr(9)] in a string. If I then try to manually edit the text (double click the cell), I see that the Cursor has been tabbed ok, but any text I then enter ignores the tab and is placed immediately after the last character in the string. Is there any way to overcome this. donwb |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There are several ways to handle the first question. Look up the Mid, Left,
Right and Characters functions in VBA help. I don't quite understand your second problem, except that cell edititing has certain protocol. "donbowyer" wrote: WinXP Excel 2003 Is it possible to programmicatically determine the position of the Cursor in a text string in a cell - eg as a count to the Right from the 1st character in the cell? Also, I have a macro which places a Tab code [Chr(9)] in a string. If I then try to manually edit the text (double click the cell), I see that the Cursor has been tabbed ok, but any text I then enter ignores the tab and is placed immediately after the last character in the string. Is there any way to overcome this. donwb |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the responses.
First Q. So what is the correct syntax for something like MyPosition=ActiveCell.CursorPosition mindful that the cell will, by definition, have to be in the Edit mode. Second Q. The macro I discussed Tabs the Cursor from the last character in the cell to a position just right of the last character. That's fine. When the macro's finished, a DoubleClick on the cell clearly shows the new Cursor position. But if I then enter new text, then hit Return, the new text is not at the Tabbed Cursor position, but back to just after the original text's last character. -- donwb "JLGWhiz" wrote: There are several ways to handle the first question. Look up the Mid, Left, Right and Characters functions in VBA help. I don't quite understand your second problem, except that cell edititing has certain protocol. "donbowyer" wrote: WinXP Excel 2003 Is it possible to programmicatically determine the position of the Cursor in a text string in a cell - eg as a count to the Right from the 1st character in the cell? Also, I have a macro which places a Tab code [Chr(9)] in a string. If I then try to manually edit the text (double click the cell), I see that the Cursor has been tabbed ok, but any text I then enter ignores the tab and is placed immediately after the last character in the string. Is there any way to overcome this. donwb |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Editing Text | Excel Discussion (Misc queries) | |||
Moving a shape with text inside without editing text | Excel Programming | |||
Editing text in text box grouped within a trapezoid | Excel Programming | |||
Possible too - ADD Text While editing a cell | Excel Programming | |||
Editing text file | Excel Programming |