#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Buttons

How do I identify a range of cells that a button is in when it is clicked?
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Buttons

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

ranswert wrote:
How do I identify a range of cells that a button is in when it is clicked?
Thanks


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 161
Default Buttons

Thank You for the help

"Andy Pope" wrote:

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

ranswert wrote:
How do I identify a range of cells that a button is in when it is clicked?
Thanks


--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Option Buttons/Radio Buttons John Calder New Users to Excel 7 May 16th 08 03:51 AM
Form buttons vs. ActiveX Buttons GeorgeJ Excel Discussion (Misc queries) 3 August 11th 07 09:02 PM
have toggle buttons but everytime print preview buttons move TinSandhu Excel Discussion (Misc queries) 1 October 11th 06 02:57 PM
Replacing macro buttons with a new set of buttons jonco Excel Programming 3 July 3rd 06 01:36 AM
Control Buttons vs. Command Buttons Robert Gibson Excel Programming 1 October 13th 03 04:33 PM


All times are GMT +1. The time now is 11:09 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"