automatically activating a word document after a macro is run ?

KenWit

Board Regular
Joined
Nov 21, 2011
Messages
68
When I run a macro I have to click on the document to activate the document before I can resume typing.
Is there a way to bypass that with a line of code so that after the macro runs I can just resume typing instead of having to click on the document first?

An example of a macro I often run:

Selection.TypeText Text:="11. "
Selection.HomeKey wdLine
Selection.MoveRight wdCharacter, 3, wdExtend
Selection.Font.Size = 11
Selection.Collapse wdCollapseEnd

(The extra required click is a bit of a nuisance.)
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
After running the macro code you posted, I don't need to click anything before typing, so maybe your Office installation needs repairing or has an issue with a 3rd-party Add-in.
 
Upvote 0
Thanks. I have this problem with 3 computers, two at home and one at work.
I'll look into the solutions you mentioned. I good to know the issue can be resolved. The extra clicks add up.
 
Upvote 0

Forum statistics

Threads
1,225,665
Messages
6,186,312
Members
453,349
Latest member
neam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top