Thread: Sheet to close
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Sheet to close

Hi,

Why not make it simpler

If ActiveSheet.Name = "Master" Then
ActiveWorkbook.Save
ActiveWorkbook.Close
End If

Mike

"oldjay" wrote:

Why won't this work?

oldjayo

Sub test()

Dim wsShtToSave As Worksheet
Set wsShtToSave = ActiveSheet
If wsShtToSave= "Master" Then
ActiveWorkbook.Save
ActiveWorkbook.Close
End If
End Sub