AI-Powered Excel Assistant
Sub ClearReport()
Sheets("报表").Range("A2:Z1000").ClearContents
End Sub
Sub ImportData()
Sheets("数据").Range("A1").CurrentRegion.Copy
Sheets("报表").Range("A1").PasteSpecial xlPasteValues
End Sub
Sub FormatReport()
With Sheets("报表").Range("A1").CurrentRegion
.Font.Name = "微软雅黑"
.Font.Size = 10
.Rows(1).Font.Bold = True
.Borders.LineStyle = xlContinuous
End With
End Sub
Sub AddTimestamp()
Range("A1").Value = "生成时间: " & Now()
End Sub
Sub SaveReport()
Dim fileName As String
fileName = "报表_" & Format(Date, "YYYYMMDD") & ".xlsx"
ActiveWorkbook.SaveCopyAs fileName
End Sub
Sub GenerateReport()
ClearReport
ImportData
FormatReport
AddTimestamp
SaveReport
MsgBox "报表生成完成!"
End Sub
自动化报表让你能将时间用于更有价值的分析工作。