Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
preventing comboboxes from triggering when sheet copied
I have 2 comboboxes that are triggering when ever I copy the sheet to
a new sheet or delete a sheet. This is generating errors. I also have a workshet_selectionCange and have isolated that this is triggering the 2 combo routines even though the combos are based on a Click event. The linked cell and reference range of the 2 comboboxes do not refer to the cells in the module below. The combobox code is in each sheet not a module. How can I modify my code to prevent the combos from triggering when a new sheet is added, deleted, etc. in the worksheet: Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range) jfactor End Sub in a module: Sub jfactor() 'Application.EnableEvents = False If Cells(27, 2).Value = 0 Then Cells(28, 2).Value = "" ElseIf Cells(28, 2) = "" Then '<==== ADD THIS CODE Cells(28, 2).Value = 1000 'whatever the default value is End If ' Application.EnableEvents = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Looping through different comboboxes in an excel sheet | Excel Programming | |||
Triggering an event whenever a new shape is added in a sheet | Excel Programming | |||
Preventing incorrect data from being copied | Excel Programming | |||
Fire events for all comboboxes in my sheet | Excel Programming | |||
Preventing a workbook from being copied | Excel Programming |