ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Focus sheet (https://www.excelbanter.com/excel-programming/312305-focus-sheet.html)

Max Potters

Focus sheet
 
Hi,

I have a little piece of code which selects another sheet, but while doing
this the focus on the sheet disappears, i.e. the blue bar you see on top of
Excel turns into vague blue, while normally this is deep blue. I tried to
use the .Select and .Activate statement, but none of these work.

I must say that I use a userform to let someone type in a password, and when
it's correct, it selects the othersheet (userform hides using the .Hide). I
don't know if this has anything to do with it, but I would like your help.

Thanks
Max



Ron de Bruin

Focus sheet
 
Hi max

Try to use this after the .Hide
AppActivate Application.Caption

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Max Potters" wrote in message ...
Hi,

I have a little piece of code which selects another sheet, but while doing this the focus on the sheet disappears, i.e. the blue
bar you see on top of Excel turns into vague blue, while normally this is deep blue. I tried to use the .Select and .Activate
statement, but none of these work.

I must say that I use a userform to let someone type in a password, and when it's correct, it selects the othersheet (userform
hides using the .Hide). I don't know if this has anything to do with it, but I would like your help.

Thanks
Max




Tom Ogilvy

Focus sheet
 
do you have

application.ScreenUpdating = False

in your code.

This might be the source of the problem if you do. Try setting it to true.

--
Regards,
Tom Ogilvy

"Max Potters" wrote in message
...
Hi,

I have a little piece of code which selects another sheet, but while doing
this the focus on the sheet disappears, i.e. the blue bar you see on top

of
Excel turns into vague blue, while normally this is deep blue. I tried to
use the .Select and .Activate statement, but none of these work.

I must say that I use a userform to let someone type in a password, and

when
it's correct, it selects the othersheet (userform hides using the .Hide).

I
don't know if this has anything to do with it, but I would like your help.

Thanks
Max





Max Potters

Focus sheet
 
I tried both of your comments, but it still doesn't help. Do you have
another solution?

Btw, if i go from sheet1 to sheet2 (this happens without a userform) the bar
is deep blue, so the focus is ok.

Max
"Max Potters" wrote in message
...
Hi,

I have a little piece of code which selects another sheet, but while doing
this the focus on the sheet disappears, i.e. the blue bar you see on top
of Excel turns into vague blue, while normally this is deep blue. I tried
to use the .Select and .Activate statement, but none of these work.

I must say that I use a userform to let someone type in a password, and
when it's correct, it selects the othersheet (userform hides using the
.Hide). I don't know if this has anything to do with it, but I would like
your help.

Thanks
Max





All times are GMT +1. The time now is 01:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com