RE: The Relative Macro
- From: DanP <DanP@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 17 Mar 2009 07:58:13 -0700
Thank you much. That's exacly what I needed. Took a little bit of time to
fully understand the Text to Column but I got it. Thanks again.
--
Dan P.
"Shane Devenshire" wrote:
Hi,.
You are using a macro when you don't need one. Take a look at the Data,
Text to Columns command. This will allow you to split the data in A1 into as
many columns as you want and keep or not keep those columns.
Why don't you post a sample of you data and explain what you want as a
result. Disregard the macro discussion.
--
If this helps, please click the Yes button.
Cheers,
Shane Devenshire
"DanP" wrote:
I know how to create a relative macro...to a point. I know that when I start
recording the macro, I have to pick the RELATIVE button in the little toolbar.
I will tell you what I want to accomplish and then what happens.
1. I have a cell (A1) that has a city, state, & zip code (Pittsburgh, PA
15212).
2. Cell B1 is empty and already formatted for text.
3. I place the cursor in cell A1 and start to record the macro.
4. I press the relative button.
5. I double click in A1, hold the shift key down and use the arrow keys to
highlight the zip code and the space in front of it. (6 arrow keystrokes to
the left)
6. When highlighted, I press Ctrl-X to cut the space and zip code and copy
it to the clipboard.
7. I hit <Enter> and the cursor moves down to the next cell. (A2)
8. I use the arrow keys to move the cursor back up and to the right cell (B1).
9. I press Ctrl-V to paste the zip code into B1 and hit <Enter> which moves
the cursor down to B2.
10. I use the arrow keys to move the cursor over to cell A2.
11. I then stop recording the macro.
You can see that I want to strip the zip codes out of one cell and put it
into another.
Here's is what happens. The macro runs great as far as the movement and the
cutting of the zip codes. But, when it moves to the next cell, it always
pastes the same number...the one that was originally cut and copied in the
original cell.
What am I doing wrong? Does it have something to do with the relative vs
actual?
Please help,
--
Dan P.
- References:
- The Relative Macro
- From: DanP
- RE: The Relative Macro
- From: Shane Devenshire
- The Relative Macro
- Prev by Date: RE: Custom Toolbar
- Next by Date: RE: Sort/Filter
- Previous by thread: RE: The Relative Macro
- Next by thread: RE: The Relative Macro
- Index(es):