amirkharkongor
New Member
- Joined
- Nov 8, 2021
- Messages
- 11
- Office Version
- 2019
- 2016
- 2010
- Platform
- Windows
- Web
Hi,
I created multiple buttons through the following code :
Set Btn = ActiveSheet.Buttons.Add(bRowRng.Left, bRowRng.Top, bRowRng.Width, bRowRng.Height)
Btn.Caption = "Update"
Btn.OnAction = "Update"
Btn.Name = "BtnName" & BtnCnt
Now I want to write another code to get the row Number of the above buttons.
I tried the following solution available in this forum but i got an error "Unable to get the Buttons property of the Worksheet class"
Sub Mainscoresheet()
' Mainlineup Macro
Dim b As Object, RowNumber As Integer
Set b = ActiveSheet.Buttons(Application.Caller) ["Unable to get the Buttons property of the Worksheet class"]
With b.TopLeftCell
RowNumber = .Row
End With
MsgBox "Row Number " & RowNumber
End Sub
Kindly help me.
I created multiple buttons through the following code :
Set Btn = ActiveSheet.Buttons.Add(bRowRng.Left, bRowRng.Top, bRowRng.Width, bRowRng.Height)
Btn.Caption = "Update"
Btn.OnAction = "Update"
Btn.Name = "BtnName" & BtnCnt
Now I want to write another code to get the row Number of the above buttons.
I tried the following solution available in this forum but i got an error "Unable to get the Buttons property of the Worksheet class"
Sub Mainscoresheet()
' Mainlineup Macro
Dim b As Object, RowNumber As Integer
Set b = ActiveSheet.Buttons(Application.Caller) ["Unable to get the Buttons property of the Worksheet class"]
With b.TopLeftCell
RowNumber = .Row
End With
MsgBox "Row Number " & RowNumber
End Sub
Kindly help me.