R
rlgh60
Probelm returning from command button click. When i start a command
button click, I call SetTheDisplayToOff(true) (see below) to set the
display and events so they not work. Then I go do a database query on
another sheet, format the sheet, then activate the first sheet that I
started from.
The last line in my command button sub is SetTheDisplayToOff(false) to
enable all events and display..
The problem is that after I click the command button, the active cell
is not highlighted, clicking on a cell does not show the cell as
selected, and the tab key does not advance to the next cell. This
first worksheet is protected so only 5 cells are unprotected for
entry.
However if I save the workbook, then all works correctly.
Any suggestions?
Mark Gordon
Public Sub SetTheDisplayToOff(displayOff As Boolean)
If displayOff Then
With Application
ScreenUpdating = False
Calculation = xlCalculationManual
EnableEvents = False
End With
Else
With Application
ScreenUpdating = True
Calculation = xlCalculationAutomatic
EnableEvents = True
StatusBar = "Ready"
StatusBar = False
CutCopyMode = False
End With
End Sub
button click, I call SetTheDisplayToOff(true) (see below) to set the
display and events so they not work. Then I go do a database query on
another sheet, format the sheet, then activate the first sheet that I
started from.
The last line in my command button sub is SetTheDisplayToOff(false) to
enable all events and display..
The problem is that after I click the command button, the active cell
is not highlighted, clicking on a cell does not show the cell as
selected, and the tab key does not advance to the next cell. This
first worksheet is protected so only 5 cells are unprotected for
entry.
However if I save the workbook, then all works correctly.
Any suggestions?
Mark Gordon
Public Sub SetTheDisplayToOff(displayOff As Boolean)
If displayOff Then
With Application
ScreenUpdating = False
Calculation = xlCalculationManual
EnableEvents = False
End With
Else
With Application
ScreenUpdating = True
Calculation = xlCalculationAutomatic
EnableEvents = True
StatusBar = "Ready"
StatusBar = False
CutCopyMode = False
End With
End Sub