# Need Help for 1 click print with data calculation include

• Currently i'm using the script below to do a click print + value change.

Is there any way to make it like 1 click print with multiple printings with different value?

1 click print out 10 copies each with different +1 value?

• Re: Need Help for 1 click print with data calculation include

Try using a loop. For example:

• Re: Need Help for 1 click print with data calculation include

Brian,

Your code will get the job done but there is a typo that will increment the cells by i not by one. I know that this is what your mind was saying but your fingers were off on an tagent

• Re: Need Help for 1 click print with data calculation include

Err...... (i ) will always be 1 in Brian's example. So Brian (welcome back to the forum by the way) your code is perfecto!!! Well done.

Slight variation which will produce the same result.

Code
``````Private Sub CommandButton1_Click()
Dim i As Integer
For i = 1 To 10
Range("D7, F7").Value = i
Sheets(1).PrintOut 1, True
Next i
End Sub``````

Take care

Smallman

• Re: Need Help for 1 click print with data calculation include

Quote

1 click print out 10 copies each with different +1 value?

Err.....using (i) in Bran's example, since (i) increments, a 5 in D7 and a 6 in F7 will produce a 50 and 51 as opposed to calculating a 15 and 16 respectively.

Err......Whereas, any values placed in D7 and F7 wil yield a 10 in both cells using small man's routine since it is simply assigning the values of the cells to what ever (i) has incremented to. This does not take into consideration the starting values of the cells.

• Re: Need Help for 1 click print with data calculation include

Wow, thanks for all the advise guys! It's very helpful, at the end i come out with this format :tongue:

I wonder is there anyway for emergency script stop, so that if i find the printing is wrong i can stop immediately.

• Re: Need Help for 1 click print with data calculation include

CTRL + Pause\Break will stop the macro in debugging mode.

• Re: Need Help for 1 click print with data calculation include

Quote from Brian Walters;664760

CTRL + Pause\Break will stop the macro in debugging mode.

OIC, then i'll need to make a easy hotkey for that. Thanks man

## Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!