View Single Post
  #9   Report Post  
Posted to microsoft.public.excel.programming
Stuart[_5_] Stuart[_5_] is offline
external usenet poster
 
Posts: 413
Default Can I do this with a TextBox?

Many thanks for all the help.

Regards.

"Dick Kusleika" wrote in message
...

"Stuart" wrote in message
...


One last question please:
How can I obtain a list of the Event options associated
with a textbox .... (and that goes for Objects/Controls
generally)? I'm sure I've seen a way to do this as soon
as the textbox (eg) is created?


Controls from the Forms or Drawing toolbars don't have events, only

OnAction
(basically a click event). Only ActiveX controls have events like
Deactivate. If you want to avoid that specific error, I think you only

need
to put your Unprotect line in the SelectionChange event. That will allow
the user to select a protected cell, but once the EnableSelection line is
run it will kick them to the next unprotected cell. I didn't test that,

but
I think it will work.

If you need to find the event associated with ActiveX controls, the

easiest
way is to open the sheet module that contains the controls. Use the left
pulldown to find the control and right pulldown will show all the events.


So if I found a (say) Textbox_Deactivate or Deselect
event, I might be able to use that to check the cell the
user had exited to, and test that for being locked ......
if so, return user to the textbox.


--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com




---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.727 / Virus Database: 482 - Release Date: 26/07/2004