Thread: Button Focus
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Patrick Molloy Patrick Molloy is offline
external usenet poster
 
Posts: 1,049
Default Button Focus


Option Explicit

Sub Worksheet_Change(ByVal Target As Range)

If Range("A1").Value < "" Then
''Buttons("Register").SetFocus
ActiveSheet.Shapes("Register").Select
Else
'........... other code..........
End If

End Sub





"Sandy" wrote in message
...
Excel 2003
I have a button from the Forms toolbar named "Register".
The button is on the sheet - not on a form.

I would like to set the focus to this button in the following code

Code
Sub Worksheet_Change(ByVal Target As Range)

If Range("A1").Value < "" Then
Buttons("Register").SetFocus
Else
........... other code..........
End if

End Sub
<<Code

Obviously this does not work - it produces the following error:-

"Run-Time error '438':
Object doesn't support this property or method"

Any help appreciated

Sandy