回覆列表
  • 1 # 使用者179650070689

    模擬資料

    先將工作簿另存為啟用宏的工作簿

    開啟VBE環境輸入程式碼,你可以使用快捷鍵ALT+F11,也可以使用滑鼠如下圖操作。

    開啟VBE環境後,選中文件單擊滑鼠右鍵,在選單裡選擇插入模組。

    選中模組後,輸入程式碼。

  • 2 # 滴逃逃

    先開啟VBE視窗,選擇選單“插入“--”模組“並輸入程式碼:

    Private Sub workbook_beforeprint(cance As Boolean)

    On Error Resume Next

    Dim print_count As Long

    With ActiveWorkbook.CustomDocumentProperties

    print_count = .Item("列印次數").Value

    If Err 0 Then

    .add name:="列印次數", linktocontent:=false, type:=msoproperty type

    Number , Value:=1

    Else

    MsgBox "本檔案列印次數:" & .Item("列印次數").Value

    End With

    End Sub

  • 中秋節和大豐收的關聯?
  • 應該如何進一步完善制度治黨?