Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() So I am trying to write some formating macro's. One of them is to delete entire rows, but the rows each contain a Checkbox. I have a snippit of code to remove checkboxes: Dim chbx As String Dim strt, fin As Integer strt = 734 fin = 1790 For i = strt To fin chbx = "Check Box " & i On Error Resume Next ActiveSheet.Shapes(chbx).Select Selection.Cut Next i The problem that I have is, that I do not know how to obtain the start and end number for the checkboxes in the range I want to delete. Is there a method to delete an entire row and the objects within it? Thanks, Phil -- pkohler ------------------------------------------------------------------------ pkohler's Profile: http://www.excelforum.com/member.php...fo&userid=8919 View this thread: http://www.excelforum.com/showthread...hreadid=385700 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have trouble dealing with objects on a sheet - so instead of check boxes I
use an event macro. using column A for my check box - one of my favorites is: Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Column = 1 Then If Len(Target) = 0 Then Target = "X" Else Target.ClearContents End If End Sub -- steveB Remove "AYN" from email to respond "pkohler" wrote in message ... So I am trying to write some formating macro's. One of them is to delete entire rows, but the rows each contain a Checkbox. I have a snippit of code to remove checkboxes: Dim chbx As String Dim strt, fin As Integer strt = 734 fin = 1790 For i = strt To fin chbx = "Check Box " & i On Error Resume Next ActiveSheet.Shapes(chbx).Select Selection.Cut Next i The problem that I have is, that I do not know how to obtain the start and end number for the checkboxes in the range I want to delete. Is there a method to delete an entire row and the objects within it? Thanks, Phil -- pkohler ------------------------------------------------------------------------ pkohler's Profile: http://www.excelforum.com/member.php...fo&userid=8919 View this thread: http://www.excelforum.com/showthread...hreadid=385700 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You have to run through the collection of the shape that you want
(or all shapes) and test for say the upper left corner of a shape being within the selected range of cells. see DelShapesSel in http://www.mvps.org/dmcritchie/excel/shapes.htm you can use the first macro getshapeproc to determine what shapes you have and where they are in case you have to restrict yourself to a particular kind of shape. ---HTH, David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htmSearch Page: http://www.mvps.org/dmcritchie/excel/search.htm "pkohler" wrote in message ... So I am trying to write some formating macro's. One of them is to delete entire rows, but the rows each contain a Checkbox. I have a snippit of code to remove checkboxes: Dim chbx As String Dim strt, fin As Integer strt = 734 fin = 1790 For i = strt To fin chbx = "Check Box " & i On Error Resume Next ActiveSheet.Shapes(chbx).Select Selection.Cut Next i The problem that I have is, that I do not know how to obtain the start and end number for the checkboxes in the range I want to delete. Is there a method to delete an entire row and the objects within it? Thanks, Phil -- pkohler ------------------------------------------------------------------------ pkohler's Profile: http://www.excelforum.com/member.php...fo&userid=8919 View this thread: http://www.excelforum.com/showthread...hreadid=385700 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Forms Checkbox | Excel Discussion (Misc queries) | |||
Click event for checkbox from Forms toolbar | Excel Discussion (Misc queries) | |||
How do I resize the actual Forms checkbox | Excel Discussion (Misc queries) | |||
EXCEL FORMS CHECKBOX | Excel Worksheet Functions | |||
Error in code to Check Forms Checkbox | Excel Programming |