In nhiều trang ở 1 sheet

Liên hệ QC

Le Huyen Le

Thành viên mới
Tham gia
1/12/21
Bài viết
3
Được thích
0
Anh chị cho e hỏi, e muốn in số trang theo mong muốn ở trong 1 sheet, nhưng code này lỗi quá, nhờ ac sửa lỗi cho e với ạ.X4 và X5 là e muốn chạy theo biến ở 2 ô để tạo nút in bên ngoài ạ
Sub printintheomongmuon()
Dim startpage As Integer
Dim endpage As Integer
startpage = InputBox("X4.", "Enter Value ")
If Not WorksheetFunction.IsNumber(startpage) Then
MsgBox "Invalid Start Page number. Please try again.", "Error"
Exit Sub
End If
endpage = InputBox("X5.", "Enter Value ")
If Not WorksheetFunction.IsNumber(endpage) Then
MsgBox "Invalid End Page number. Please try again.", "Error"
Exit Sub
End If
Selection.PrintOutFrom:=startpage, To:=endpage, Copies:=1,
Collate:=True
End Sub
 
Web KT
Back
Top Bottom