PDA

View Full Version : [SOLVED:] Can this be done? User form stop blocking document



Mihaelaa
12-01-2013, 10:19 AM
Hello everyone,

I am new to VBA and I have never written any full code on my own, just used bits and pieces from the net, and modified them. But this time I couldn't find anything to help me, so I am hoping that someone knows the answer to this. I am in the the following situation:

I have a word document which containts in random places lines of text on which a number of changes need to be done, lines which can only be identified by a person(can't make wildcard expressions, or any form of automation).

I can implement the modifications I want done in a user form with many buttons. Is is possible to make the user form not block my document when I want to select text from it? I made the user form and the functions I want on the buttons but when I run the macro, the document gets blocked and I can't select anything.

Is it even possible in VBA to have a document and a user form opened, and select a piece of text, and press a button to change that text, then select another piece of text anywere and have the interface there, not disappear or blocking the document? Am I doing something wrong, or is it simply not possible?

macropod
12-01-2013, 04:36 PM
You can load the userform in a modeless state. That will allow you to switch between the userform and the document, much the same as when you're using the Find/Replace dialogue. The code for this would be like:

UserForm1.Show vbModeless

Mihaelaa
12-02-2013, 12:33 AM
Hello,

This is the perfect solution for my problem.

Thank you very much.