PDA

View Full Version : [SOLVED:] Check mysheet is active



ilyaskazi
04-19-2005, 08:28 PM
i need to check whether "mysheet" is active or not

means..,

if "mysheet" is active then
display msgbox "Yes"
end if

Ken Puls
04-19-2005, 08:36 PM
Hi there,

Try:


If activesheet.name ="mysheet" then
msgbox "Yes"
End if

Oh, and by the way... mysheet is case sensitive in the above. So if your sheet is actually called MySheet, it won't ring true.

To take out the case sensitivity issue, try this:

If UCase(ActiveSheet.Name) = UCase("mysheet") Then
MsgBox "yes"
End If

TonyJollans
04-20-2005, 01:27 AM
Or, if mysheet is a worksheet object reference rather than a sheet name, ..


If ActiveSheet Is mysheet Then
MsgBox "Yes"
End If

Ken Puls
04-20-2005, 08:53 AM
Hmmm...

Good point, Tony. I saw quotes and assumed that it would be a string. Good to have the other possibility though. :yes

ilyaskazi
04-21-2005, 07:19 AM
thankyou kpuls, Tony...:thumb