Sheet prints twice

admat

New Member
Joined
Dec 20, 2018
Messages
17
Good Day,
I have button when clicked it prints a range of rows on a template.

Code:
Application.Dialogs(xlDialogPrint).Show
    RowCount = Range("B2")
    
    Worksheets("Payslips").Select
        For i = 1 To RowCount Step 5
            Range("B4").Value = i
            ActiveSheet.PrintOut Copies:=1
        Next i
   End Sub
B2 has the count of all the rows. Currently there are 5 rows of data
B4 the user enters from which row to print. Start row is 1.

The page is set to fit 5 rows so I should only get 1 page but it is printing the same page twice.

thanks in advance
 
Last edited:

John_w

MrExcel MVP
Joined
Oct 15, 2007
Messages
5,945
Try deleting the first line - that will print if you click OK on the dialogue.
 

Forum statistics

Threads
1,077,919
Messages
5,337,185
Members
399,131
Latest member
Vinnyjuice

Some videos you may like

This Week's Hot Topics

Top