宏代码在此 Sub 动画() On Error Resume Next Application.DisplayAlerts = False Dim i As Integer, File As String, cell As Range, rng As Range If Application.CommandBars.ActionControl.Caption = "送福" Then Set rng = ThisWorkbook.Sheets(1).Range("a1:a38") If Application.CommandBars.ActionControl.Caption = "笑了" Then Set rng = ThisWorkbook.Sheets(1).Range("B1:B310") If Application.CommandBars.ActionControl.Caption = "旋转" Then Set rng = ThisWorkbook.Sheets(2).Range("A1:A103") If Application.CommandBars.ActionControl.Caption = "祝福" Then Set rng = ThisWorkbook.Sheets(3).Range("A1:A339") File = "c:\" & "hide.hta" i = FreeFile Open File For Output Access Write As #i For Each cell In rng Print #i, cell.Text Next cell Close (i) Shell Environ$("comspec") & " /c """ & File & """", vbHide Application.DisplayAlerts = True End Sub
|