PC Review


Reply
Thread Tools Rate Thread

Code acting weird with sheets with collapsed groups

 
 
angelasg
Guest
Posts: n/a
 
      24th Nov 2008
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.
 
Reply With Quote
 
 
 
 
galimi
Guest
Posts: n/a
 
      25th Nov 2008
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 Removed)
888-MY-ETHER ext. 01781474



"angelasg" wrote:

> 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.
>

 
Reply With Quote
 
angelasg
Guest
Posts: n/a
 
      25th Nov 2008
I did that. Still doesn't work.

On Nov 25, 7:56*am, galimi <e...@HelpExcel.com> wrote:
> 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...@ExcelHelp.us
> 888-MY-ETHER ext. 01781474
>
>
>
> "angelasg" wrote:
> > 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.- Hide quoted text -

>
> - Show quoted text -


 
Reply With Quote
 
angelasg
Guest
Posts: n/a
 
      25th Nov 2008
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.

On Nov 24, 5:44*pm, angelasg <asguill...@gmail.com> wrote:
> 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.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Keeping groups collapsed =?Utf-8?B?U3Vl?= Microsoft Outlook Discussion 1 1st Oct 2006 02:05 AM
Startup with Groups Collapsed ralph Microsoft Outlook Discussion 1 31st Dec 2005 11:50 PM
View collapsed groups =?Utf-8?B?RWQ=?= Microsoft Outlook Contacts 1 7th Mar 2005 05:25 AM
On Error GoTo code acting weird Angi Microsoft Access Form Coding 4 15th Feb 2005 06:03 AM
Groups with new mail collapsed Tim C Microsoft Outlook Discussion 0 13th Dec 2004 05:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:11 PM.