Private Sub Workbook_Open()
With Sheets(1)
If WorksheetFunction.CountA(.Range("a:a")) = 0 Then Call macro
ThisWorkbook.Save
If Hour(Time) >= 1 And Hour(Time) <= 15 Then ThisWorkbook.Close
End With
End Sub
Private Sub Workbook_Open()
With Sheets(1)
If WorksheetFunction.CountA(.Range("a:a")) > 0 Then Call macro
ThisWorkbook.Save
If Hour(Time) >= 1 And Hour(Time) <= 15 Then ThisWorkbook.Close
End With
End Sub
统计单元格要大于0才对!
Private Sub Workbook_Open()
ano = Sheet1.[a65535].End(xlUp).Row
If (ano = 1 And Len(Trim(Sheet1.[a1])) > 0) Or ano > 1 Then
Call 宏
End If
If Time > "01:00:00" And Time <= "15:00:00" Then
ThisWorkbook.Close True
Else
ThisWorkbook.Save
End If
End Sub