Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Non Working Cells after command button
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 ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Non Working Cells after command button
rlgh60'
You've set up a "Catch 22" situation. By setting EnableEvents to false, the second CommandButton_Click event is not being recognised. You'll have to re-enable events somewhere/somehow else or not set it to false. HTH Henry "rlgh60" wrote in message ... 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 ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Form command not working on worksheet with merged cells | Excel Discussion (Misc queries) | |||
print 20 cells with a command button | Excel Discussion (Misc queries) | |||
command button isn't working | New Users to Excel | |||
Using Command Button to copy cells | Excel Discussion (Misc queries) | |||
Command Button vs Form Button | Excel Programming |