Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default 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
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
Need Help with ActiveCell.EntireRow.Delete Ayo Excel Discussion (Misc queries) 4 July 20th 08 11:07 AM
Need Help with ActiveCell.EntireRow.Delete Ayo Excel Discussion (Misc queries) 8 July 19th 08 04:45 PM
delete entirerow if date more than 12months old flow23 Excel Discussion (Misc queries) 1 May 25th 06 03:32 PM
Using SpecialCells().EntireRow.Delete on large worksheet - Very slow! Ilan[_2_] Excel Programming 6 September 15th 04 12:09 PM
entirerow.delete multiple text conditions Jocelyn[_3_] Excel Programming 3 February 9th 04 05:58 PM


All times are GMT +1. The time now is 11:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"