Print 2 copys using button

oxicottin

Board Regular
Joined
Feb 21, 2007
Messages
126
Hello, I have this bit of code someone gave me a while back and I needed to make an adjustment. What it does is in A1 is a number 4 and in B7 there is a date starting on monday. and a button that runs the code. It prints mon, tues,wed thurs and skips back to monday. what I need it to do is print monday twice tues twice ect. for the 4 days. thanks!

Code:
Sub FourDays()

Dim lngMyCount As Long

With Sheets("Plant Attendance Four Day")

    For lngMyCount = 1 To .Range("A1")

        .PrintOut
        .Range("B7") = .Range("B7") + 1

    Next lngMyCount
    
End With
'Increment
ActiveSheet.Range("B7").Value = ActiveSheet.Range("B7").Value + 3
ActiveSheet.Calculate
End Sub
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Add a second .PrintOut line perhaps? (unless I'm not understanding your question correctly).

Code:
Sub FourDays()
 
Dim lngMyCount As Long
 
With Sheets("Plant Attendance Four Day")
 
For lngMyCount = 1 To .Range("A1")
 
.PrintOut
.PrintOut
 
.Range("B7") = .Range("B7") + 1
 
Next lngMyCount
 
End With
'Increment
ActiveSheet.Range("B7").Value = ActiveSheet.Range("B7").Value + 3
ActiveSheet.Calculate
End Sub
 
Upvote 0
Code:
Sub FourDays()

Dim lngMyCount As Long

With Sheets("Plant Attendance Four Day")

    For lngMyCount = 1 To .Range("A1")

        For i = 1 to .Range("B1")
            
            .PrintOut
            
        Next i
        
        .Range("B7") = .Range("B7") + 1

    Next lngMyCount
    
End With
'Increment
ActiveSheet.Range("B7").Value = ActiveSheet.Range("B7").Value + 3
ActiveSheet.Calculate
End Sub

Specify the number of printouts you want in B1 before running this.
 
Upvote 0
Thanks guys I will try it on Monday..... I left my workbook at work :( so I will have to try Monday.

Just to touch up on what I wanted to do cuz I hurried and posted before I left work. I wanted to print out two printouts of the same day for four days and then skip 3 days so it would look like this.

1) Monday 7/11/11, Monday 7/11/11
2) Tuesday 7/12/11 Tuesday 7/12/11
3) Wed 7/13/11 Wed 7/13/11
4) Thurs 7/14/11 Thurs 7/14/11
5) Now it skips 3 days and your date field is on 7/18/11
 
Upvote 0

Forum statistics

Threads
1,224,544
Messages
6,179,430
Members
452,915
Latest member
hannnahheileen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top