Mình đang có đoạn code sau để in hồ sơ ra PDF, nhưng khi in thì bị tách rời ra từng file nhỏ. Nhờ mọi người giúp đỡ mình gộp các lệnh in thành 1 file PDF được ko? Thanks alot!
Mã:
Sub INHOSO()
Dim i As Long, m As Long, n As Long
m = Sheets("PL").Range("M5").Value
n = Sheets("PL").Range("M6").Value
For i = m To n
If i = m Then
Sheets("PL").Range("M3").Value = i
Sheets("BIALO").PrintOut
Sheets("PL").PrintOut
Sheets("PYC").PrintOut , from:=1, to:=1
Sheets("BBNT").PrintOut , from:=1, to:=4
Sheets("KLDAO").PrintOut , from:=1, to:=1
Sheets("PYC").PrintOut , from:=2, to:=2
Sheets("BBNT").PrintOut , from:=5, to:=6
Sheets("PYC").PrintOut , from:=3, to:=3
Sheets("BBNT").PrintOut , from:=7, to:=8
Sheets("PYC").PrintOut , from:=4, to:=4
Sheets("BBNT").PrintOut , from:=9, to:=10
Sheets("LMVUA").PrintOut
Sheets("PYC").PrintOut , from:=5, to:=5
Sheets("KLTHEP").PrintOut , from:=1, to:=1
Sheets("BTTC").PrintOut , from:=1, to:=3
Sheets("LMBTTC").PrintOut
Sheets("PYC").PrintOut , from:=6, to:=6
Sheets("BBNT").PrintOut , from:=15, to:=16
Sheets("KLBTTC").PrintOut , from:=1, to:=1
Sheets("PYC").PrintOut , from:=7, to:=7
Sheets("BBNT").PrintOut , from:=17, to:=18
Sheets("KLDAP").PrintOut , from:=1, to:=1
Sheets("PYC").PrintOut , from:=8, to:=8
Sheets("BBNT").PrintOut , from:=19, to:=20
Sheets("PYC").PrintOut , from:=9, to:=9
Sheets("BBNT").PrintOut , from:=21, to:=22
Sheets("PYC").PrintOut , from:=10, to:=10
Sheets("BBNT").PrintOut , from:=23, to:=24
Sheets("PYC").PrintOut , from:=11, to:=11
Sheets("BBNT").PrintOut , from:=25, to:=26
Sheets("BTLE").PrintOut , from:=1, to:=3
Sheets("LMLE").PrintOut
Sheets("PYC").PrintOut , from:=12, to:=12
Sheets("BBNT").PrintOut , from:=27, to:=28
Sheets("PYC").PrintOut , from:=13, to:=13
Sheets("BBNT").PrintOut , from:=29, to:=30