|
こんにちは
地道にループで処理してみました。^d^
Sub 種類毎に印刷()
Dim T As Long, B As Long
Dim i As Long
Dim myVal0 As Variant
Dim myVal As Variant
i = 1
T = 1: B = T
myVal0 = Cells(i, 1).Value
Do
i = i + 1
myVal = Cells(i, 1).Value
If myVal = "" Then Exit Do
If myVal = myVal0 Then
B = B + 1
Else
印刷 T, B
T = B + 1
B = T
myVal0 = myVal
End If
Loop
印刷 T, B
End Sub
Sub 印刷(T As Long, B As Long)
Dim myRange As Range
With ActiveSheet
Set myRange = .Range("A" & T & ":X" & B)
.PageSetup.PrintArea = myRange.Address
.PrintPreview
End With
Set myRange = Nothing
End Sub
|
|