Freeze cursor position while running a macro

K

Kamran

Is it possible to freeze the cursor position while running a macro? I want
the user to be able to click an Option Button that goes and changes a bunch
of fields, but I want the cursor to stay where it is so that after it's done,
the user can just continue where they left off. The way it is now, the focus
ends up on the last field being modified, which is far away from the Option
Button being clicked.
Thanks.
 
R

Robert M. Franz (RMF)

Hello Kamran
Is it possible to freeze the cursor position while running a macro? I want
the user to be able to click an Option Button that goes and changes a bunch
of fields, but I want the cursor to stay where it is so that after it's done,
the user can just continue where they left off. The way it is now, the focus
ends up on the last field being modified, which is far away from the Option

non-developer here, so take the following with a grain of salt!

I see basically two possiblities:

1. you save the cursor position and place it there again after you're
code is through with the serious stuff, or

2. you use the range instead of the selection object in your code (or an
altogether different approach to do your changes).

If this all sounds Greek to you, see the "Beginners' tips" in
http://word.mvps.org/FAQs/MacrosVBA/index.htm

Specific VBA questions are best posed in one of the .vba newsgroups.

HTH
Robert
 

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