版权声明:本文为博主原创文章,转载请在显著位置标明本文出处以及作者网名,未经作者允许不得用于商业目的。
批量打印Excel时,以下代码可以实现按清单和按文件夹(含子文件夹打印):
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
Dim iPath As String, i As Long
Dim t
Dim PathLen As Integer
Dim RunSignal As Variant, Reply As Variant
Dim Tr As Single, Tc As Single
Tr = Target.Row
Tc = Target.Column
If Tr = 1 Then
If Tc = 1 Then
RunSignal = "List"
Reply = MsgBox("This operation will print out files listed in column A! Please make sure your print setting is excellent enough!", vbOKCancel, "Warning")
If Reply = vbCancel Then
Exit Sub
End If
ElseIf Tc = 3 Then
RunSignal = "Folder"
Reply = MsgBox("This operation