Hello, I programmed a click event handler for a button on a worksheet. In this handler I wanted to change some cells. But when the handler changed the first cell it aborted directly after the comand. Here's my code: This is the event handler itself, it is calling another function that is doing the work: Private Sub bReorgWorkTime_Click() ReorgWorkTime bReorgWorkTime.Parent End Sub Public Function ReorgWorkTime(xButtonWorksheet As Worksheet) Dim iDay As Integer Dim xWorkTime As Variant Dim xReorgedTime As Variant Dim dWorkTime As Double Dim bOldEventsEnabled As Boolean iDay = ROW_DAY_1 bOldEventsEnabled = Application.EnableEvents Application.EnableEvents = False ' Fill in all days without over times: While (iDay <= ROW_DAY_31) xWorkTime = xButtonWorksheet.Cells(iDay, COL_WORKED_TIME) If (IsNumeric(xWorkTime) And Not IsEmpty(xWorkTime)) Then dWorkTime = xWorkTime xButtonWorksheet.Cells(iDay, COL_REORGED_TIME) = dWorkTime ' Aborts here Else xButtonWorksheet.Cells(iDay, COL_REORGED_TIME) = "" ' or here End If iDay = iDay + 1 Wend Application.EnableEvents = bOldEventsEnabled End Function Believing the debugger the "iDay = iDay + 1" line isn't even reached! I use Excel 2002 SP-1 German
R
R Schmidt
@R Schmidt