problem in VB codes

D

Dave Peterson

I'd add another delayed procedure in the WaitABit procedure.

....
End Sub
Private Sub WaitABit()
Me.Range("G13:I32").Font.ColorIndex = 2
Me.PrintOut preview:=True, Copies:=1, Collate:=True

'toggle your commandbutton value here!

'and call another procedure
Application.OnTime earliesttime:=Now + TimeSerial(0, 0, 1), _
procedure:="'" & ThisWorkbook.Name & "'!" & Me.CodeName & ".WaitABit2"
End Sub
Private Sub WaitABit2()
'do your setup and print here
End Sub
hi Dave,
I removed preview:=true and it works fine.how about if wanna repeat the
second print with toggled optionbutton?in other words, I'd like to have one
print with ColorIndex = xlAutomatic (no matter what optionbutton is selected)
and two more prints with different optionbutton selected.now I have only two
of them.thanx again
 
G

Guest

I'm confused.which line should I add to the "waitabit" procedure?and what's
the "waitabit2"?
 
D

Dave Peterson

There's an added .ontime line in the WaitABit changed procedure that calls
waitabit2.

And WaitABit2 is the procedure where you'd print the 3rd time.
I'm confused.which line should I add to the "waitabit" procedure?and what's
the "waitabit2"?
 
G

Guest

thank you Dave.got it.

Dave Peterson said:
There's an added .ontime line in the WaitABit changed procedure that calls
waitabit2.

And WaitABit2 is the procedure where you'd print the 3rd time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top