Excel Macro

S

Steve

I have create a few Macros in Excel, where I want to
automate a few entries to speed things up.

The main one is to do a word-wrap in a row of cells, and
merge the cells at the same time.

It works, but everytime it jumps back to the row I create
it in?

I want to do it in whatever row I chose.

This seems to happen with other macros also?

I guess what I need is a 'generic' macro that works in
whatever cell or row I chose afte creation?

Thank you.
 
B

Beth Melton

I suspect you recorded the macro? If so then you need to:

- Place your cell pointer in the cell you wish to modify before turning on the macro recorder
- When you start recording click "Relative Reference" on the macro toolbar prior to recording your actions.

Otherwise you are recording a macro which contains Absolute cell references and it will always 'play back' on the same cells you used while recording.

Another item to consider is when you record a dialog box you may also be recording options you do not want applied. For example if all you want is Word Wrap and Merged Cells then your macro should look something like:

With Selection
.WrapText = True
.MergeCells = True
End With
--
Please post all follow-ups to the newsgroup. Email requests for assistance can not be acknowledged.

~~~~~~~
Beth Melton

Word FAQ: http://mvps.org/word
TechTrax: http://mousetrax.com/techtrax/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top