Buttons

  • Thread starter Thread starter ranswert
  • Start date Start date
R

ranswert

How do I identify a range of cells that a button is in when it is clicked?
Thanks
 
Hi,

This will report cells covered by a button from the Forms toolbar.

Sub Button3_Click()

With ActiveSheet.Shapes(Application.Caller)
MsgBox "Button is over cells " & _
.TopLeftCell.Address & ":" & _
.BottomRightCell.Address
End With

End Sub

Cheers
Andy
 
Thank You for the help

Andy Pope said:
Hi,

This will report cells covered by a button from the Forms toolbar.

Sub Button3_Click()

With ActiveSheet.Shapes(Application.Caller)
MsgBox "Button is over cells " & _
.TopLeftCell.Address & ":" & _
.BottomRightCell.Address
End With

End Sub

Cheers
Andy
 

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

Back
Top