Activesheet <> Sheets("Name")

  • Thread starter Thread starter Etrnal168
  • Start date Start date
E

Etrnal168

Hello guys, can I get some help with macros?

I am trying to write a line that says

If activesheet <> Sheets("blahblah") then
exit sub

But of course, that didn't work. What should be the correct code?

Also, sometimes when show the user an input box asking them to typ
something then select OK or Cancel, when the users try to move the box
the box doesn't refresh and their entire screen ends up with the shado
of the box; like a trail of the message box. Is there a way t
eliminate that?

Thanks
 
On the first

If Activesheet.Name = "blahblahblah" Then

On the second, did you turn ScreenUpdating off before the Inputbox?


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
If activesheet.name <> Sheets("blahblah").name then

The shadow can be removed by turning the screen updating back on just prior
to the input box and back off just after the input box. You need to ensure
that you have not moved your cursor or changed sheets to do this... otherwise
the entire screen will change at the inputbox.
 
Wow, great.

Thank you very much Jim and Bob for the help! Appreciate it.

-Thomas
 

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

Back
Top