LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Finding Row or Button Name

Hi Bruno,

Ok, very useful Norman.
Then again:
How to find the macro a button is assigned to?


Try
'============
Sub Tester3A()
Dim Rng As Range
Dim WB As Workbook
Dim SH As Worksheet
Dim BTN As Button
Const sStr As String = "Button 12" '<<==== CHANGE
Dim StrAddress As String
Dim StrMacro As String


Set WB = ActiveWorkbook '<<======= CHANGE

For Each SH In WB.Worksheets
On Error Resume Next
Set BTN = SH.Buttons(sStr)
On Error GoTo 0
If Not BTN Is Nothing Then
StrAddress = _
BTN.TopLeftCell.Address(external:=True)
StrMacro = BTN.OnAction
Exit For
End If
Next SH

If Not BTN Is Nothing Then MsgBox StrAddress _
& vbNewLine & StrMacro

End Sub
'<<============

---
Regards,
Norman


 
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
Create floating button based on button click in menu ExcelMonkey Excel Programming 2 October 12th 05 06:43 PM
Adding .xla button for Toggle Calculation Button Mike Excel Programming 5 August 19th 05 01:55 PM
How do I lock a radio button group if a N/A button is selected worry a lot Excel Discussion (Misc queries) 2 May 21st 05 08:33 PM
Finding a button Brad E Excel Programming 2 May 14th 04 09:23 PM
Delete a custom button by holding down the ALT key and dragging the button off the toolbar Stephen[_8_] Excel Programming 0 April 4th 04 02:22 PM


All times are GMT +1. The time now is 12:02 PM.

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"