You would need to loop through all the buttons and check there TopLeftCell property. If it matches the current row the delete the control
You would need to loop through all the buttons and check there TopLeftCell property. If it matches the current row the delete the control
I use the TopLeftCell property to select the cell under the button, but that is as much as I know. Can I get an example of how to use it in the loop as discribed and then delete the control?
Thank you
Assumes the buttons are assigned to PressMe macro
![]()
Sub PressMe() Dim shpTemp As Shape Dim lngRow As Long Dim lngIndex As Long lngRow = ActiveSheet.Shapes(Application.Caller).TopLeftCell.Row For lngIndex = ActiveSheet.Shapes.Count To 1 Step -1 If ActiveSheet.Shapes(lngIndex).TopLeftCell.Row = lngRow Then ActiveSheet.Shapes(lngIndex).Delete End If Next ActiveSheet.Rows(lngRow).Delete End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks