Disable UserForm Objects

  • Thread starter Sean Connery via OfficeKB.com
  • Start date
S

Sean Connery via OfficeKB.com

I have been making use of UserForms to enter information into an Excel
spreadsheet. Sometimes, when raising the forms it is necessary to enter
information into some of the objects on the UserForms. Unfortunately, this
activates some of the macros relevant to these objects, which I would
initially prefer not to do. Is it possible to disable the macros on
UserForms, in much the same way as event procedures can be disabled in
Worksheet objects?

If anyone can help, please respond. Thank you.
 
B

Bob Phillips

Thi is a technique I use to stop re-entry into an event


Private fEnabled As Boolean

Private Sub TextBox1_Change()
If fEnabled Then
fEnabled = False
'do your stuff
fEnabled = True
End If
End Sub

Private Sub UserForm_Initialize()
fEnabled = True
End Sub

You can use it by adding to those controls tou want tro disabole, and set
fEnabled to false.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

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