Sheet.Select is not working - why?
Thanks Halim,
That solved my problem.
BR
MakeLei
"Halim" wrote:
because you assign sh as codename not sheet object
try to change :
set sh = ActiveSheet
--
Regards,
Halim
"Makelei" wrote:
Hi,
I have written code as below:
Private Sub Worksheet_Deactivate()
Dim sh, Target
On Error GoTo ErrorHandler
sh = ActiveSheet.CodeName
Application.EnableEvents = False
CompSel
Debug.Print sh
MsgBox sh & ".Select"
sh.Select
' Sheet5.Select
ErrorHandler:
Application.EnableEvents = True
End Sub
Why this code does not accept "sh.Select" but "Sheet5.Select" is OK. "MsgBox
sh & ".Select"" gives exatly same output.
Thanks
MakeLei
|