I’m trying to record a couple of macros to help me edit a document. The document is all text.
Text that should be in one cell is often divided into several adjacent cells, and I need to get all of this text into one cell. So I need two macros, one to select and cut the text from a cell, and the other to paste that text onto the end of the current contents of another cell.
The first macro I recorded was to select and cut the contents of a cell, but it didn’t work as I expected.
The keystrokes I recorded are:
F2 (to Edit the cell)
Ctrl-Shift-Home (to select the entire cell)
Ctrl-X (to cut onto the clipboard)
Now at that point, I would like to exit Edit mode and return to Ready mode (without leaving the cell). The only way I know to do this is either to press Tab or click in another cell (then move back to the original cell). But when I do that, the cell I end up in gets designated as the cell where the macro always ends. Excel thinks I always want it to end up on that particular cell, wheras I want it to end up in whatever cell I’m working on (i.e., I want it to think in relative positioning, not absolute).
I also discovered that when I run the macro a second time, it pastes the first selection rather than the current selection, i.e., the clipboard is not getting updated.
So my questions are:
1. Is there a way to exit Edit mode (and return to Ready mode) without leaving a cell?
2. How do I tell Excel to treat the macro’s keystrokes in a relative positioning sense, not an absolute sense?