Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I delete entirerow that contains few command buttons
Hi all,
How can I have a command button that execute to delete entirerow, which few other command buttons are contains inside this row. If I do EntireRow.Select , it won't select the button objects which are on top of this row. Pls help. Many Thanks John |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How do I delete entirerow that contains few command buttons
John
Those buttons live on a layer that is different than the cell grid. If you want to delete row 10, for instance, you could delete all the buttons on that row, then delete the row. Sub DelRowAndButtons() Dim cb As Button With Sheet1.Range("A10").EntireRow For Each cb In Sheet1.Buttons If Not Intersect(cb.TopLeftCell, .Cells) Is Nothing Then cb.Delete End If Next cb .Delete End With End Sub This loops through all the buttons on the sheet. If the TopLeftCell (which is a Range object) is in the Row 10, it is deleted. Then Row 10 is deleted. -- Dick Kusleika MVP - Excel Excel Blog - Daily Dose of Excel www.dicks-blog.com "John" wrote in message ... Hi all, How can I have a command button that execute to delete entirerow, which few other command buttons are contains inside this row. If I do EntireRow.Select , it won't select the button objects which are on top of this row. Pls help. Many Thanks John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need Help with ActiveCell.EntireRow.Delete | Excel Discussion (Misc queries) | |||
Need Help with ActiveCell.EntireRow.Delete | Excel Discussion (Misc queries) | |||
delete entirerow if date more than 12months old | Excel Discussion (Misc queries) | |||
Using SpecialCells().EntireRow.Delete on large worksheet - Very slow! | Excel Programming | |||
entirerow.delete multiple text conditions | Excel Programming |