Created
July 6, 2015 13:53
-
-
Save DouglasdeMoura/d760f337d0f402c7b2c2 to your computer and use it in GitHub Desktop.
Get row and col of a button when clicked
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Public Function ButtonRow() | |
Dim b As Object, RowNumber As Integer | |
Set b = ActiveSheet.Buttons(Application.Caller) | |
With b.TopLeftCell | |
RowNumber = .Row | |
End With | |
ButtonRow = RowNumber | |
End Function | |
Public Function ButtonCol() | |
Dim b As Object, cs As Integer | |
Set b = ActiveSheet.Buttons(Application.Caller) | |
With b.TopLeftCell | |
cs = .Column | |
End With | |
ButtonCol = RowNumber | |
End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment