Code acting weird with sheets with collapsed groups

A

angelasg

First of all, I'm using Excel 2002

I have some code like this:

Private Sub Worksheet_Deactivate()

'look for a value in a certain cell on the sheet the user just
deactivated
'if a certain value is there, go back to the sheet the user just
deactivated
'essentially, the user can't go to any other sheet unless they change
the value of a certain cell first

End Sub

The code works fine EXCEPT when the user clicks on a sheet with
grouped rows and/or columns that have any of those groups collapsed.
When that happens, Excel stays on the sheet they just clicked and
whatever cell was last activated blinks black and white.

This seems like a bug to me. Am I doing something wrong? Is this a
known issue?

Any help would be appreciated. If you need more detail, please let me
know.

Thanks.
 
G

galimi

Angela,

It appears that you need to disable events.
Use

application.enableevents=false

in the beginning of the routine & then change it to true before the routine
ends.
 
A

angelasg

I did that. Still doesn't work.

Angela,

It appears that you need to disable events.
Use

application.enableevents=false

in the beginning of the routine & then change it to true before the routine
ends.
--http://www.ExcelHelp.us
(e-mail address removed)
888-MY-ETHER ext. 01781474













- Show quoted text -
 
A

angelasg

Actually, I've just discovered that my code works if all groups are
either completely collapsed or completely expanded. If some groups
are collapsed while other groups are expanded, that's when the error
happens.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top