|
今試してみたら、Thisworkbookは、こんな感じにしないとダメでした。
シートの位置関係の問題だと思うけど...。
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim Ws As Worksheet, FM As Object 'UserForm XX
Application.ScreenUpdating = False
For Each Ws In ThisWorkbook.Sheets
If Ws.Name = "ダミー" Then
Ws.Range("IV1").Value = ActiveSheet.Name
Ws.Visible = True
End If
Next
For Each Ws In ThisWorkbook.Sheets
If Ws.Name <> "ダミー" Then
Ws.Visible = xlVeryHidden
End If
Next
If Flg = False Then
'一応ここら辺が保存時の時間差が出るところ。
Application.OnTime Now + TimeValue("00:0:01"), "表示"
End If
Flg = False
Application.ScreenUpdating = True
End Sub
|
|