View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Dick Kusleika[_3_] Dick Kusleika[_3_] is offline
external usenet poster
 
Posts: 599
Default Can I do this with a TextBox?


"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