Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Functionality: To Remove an OLE check box in the row when the user deletes a
row. This is my current attempt. I get an error message "Can't enter break mode at this time". The CheckBox is not linked, it is for visual and print only. There are remmed statements from previous attempts. Any ideas on this one? '** Snipped ****************** Dim rowcount As Long Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo Err_Worksheet_Change Dim llCanDeleteTheBox As Boolean Dim lcCheckBoxToDelete As String 'Application.EnableEvents = False 'should be part of Change macro If IsEmpty(rowcount) Then '* First time through ... *' Else If ActiveSheet.UsedRange.Rows.Count = rowcount - 1 Then '* A row was deleted *' lcCheckBoxToDelete = "CheckBox" + Trim(Str(ActiveSheet.Range("A" + Trim(Str(Target.Row))).Value)) For Each Obj In ThisWorkbook.ActiveSheet.OLEObjects '* Find the Relative Checkbox *' Stop If Obj.Name = lcCheckBoxToDelete Then Stop 'Obj.Delete llCanDeleteTheBox = True 'lcCheckBoxToDelete = Obj.Name 'ThisWorkbook.ActiveSheet.OLEObjects(Obj.Name).Del ete Exit For End If Next End If End If If llCanDeleteTheBox Then Stop '* Delete the Check Box *' ThisWorkbook.ActiveSheet.OLEObjects(lcCheckBoxToDe lete).Delete End If rowcount = ActiveSheet.UsedRange.Rows.Count '** End of SNIPPED ***************** -- B Good Lad |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting Check Boxes Within a Range | Excel Programming | |||
deleting check control box | Excel Discussion (Misc queries) | |||
Deleting check boxes | Excel Programming | |||
Deleting check boxes | Excel Programming | |||
Check if Userform exsists before deleting via VB | Excel Programming |