View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
davidm davidm is offline
external usenet poster
 
Posts: 1
Default SetFocus: conditional use of


I have trouble making the *control with focus * a subject of a
condition. Eg. if Commanbutton x has the focus at launch time, I
would want to put it out of commission (disable it). As I exit the
UserForm (with 48 CmdButtons), the focus could be set on any one of
them. Upon re-opening, the intention is to disable the last button that
had the focus for the entire duration of the next rsession.


What is the right syntax to use? The following failed with "Compile
Error Expected Function or Variable" message.

If CommandButton3.SetFocus Then
......
End if


David


--
davidm
------------------------------------------------------------------------
davidm's Profile: http://www.excelforum.com/member.php...o&userid=20645
View this thread: http://www.excelforum.com/showthread...hreadid=480990