Hi, I use this code to print envelopes, is there a way to modify it so that I can select how many to print from cell value in cell P15. Sheets("Env")
Please Login or Register to view this content.
Hi, I use this code to print envelopes, is there a way to modify it so that I can select how many to print from cell value in cell P15. Sheets("Env")
Please Login or Register to view this content.
This should work:
Please Login or Register to view this content.
Good Luck...
I don't presume to know what I am doing, however, just like you, I too started somewhere...
One-day, One-problem at a time!!!
If you feel I have helped, please click on the [★ Add Reputation] to left of post window...
Also....Add a comment if you like!!!!
And remember...Mark Thread as Solved...
Excel Forum Rocks!!!
Hi, thanks for your reply. I pasted in the suggestion as below but I get a Run-time error 1004
The number must be between 1 and 32767. Try again by entering a number within this range.
Please Login or Register to view this content.
What value are you putting in P15
I was trying it with 1
What is cell.P15 formatted as
I just tried it with 23, same error
The cell is formatted as General
Upload a sample file as it works on my side when tested.
Are you talking about P15 on the "Env" sheet? Or another sheet? I suspect it is a different one, but "Env" is active, so it is looking in P15 of that sheet. Add the sheet reference (to the one with the value in P15) to the code:
It could be I'm wrong of course... the original post does suggest it is in P15, but this was the first scenario that popped into my mind...Please Login or Register to view this content.
Please help by:
Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know
There are 10 kinds of people in this world... those who understand binary, and those who don't.
@ Arkadi
True...I just assumed that OP was printing active sheet....
@sintek, I'm sure he is, the question is, is that the source of the P15 value. Once I re-read his original post I'm less confident my answer applied, but left it up just in case...
Yes Arkadi P15 is on the same sheet.
I don't think the problem is with P15 , is it with the complete line in the code. From the , after Value
Please Login or Register to view this content.
@ Arkadi
I actually do think that you are right...Only problem I can foresee...
EDITED:
@ A440
Code tested fine....Upload a sample workbookI don't think the problem is with P15 , is it with the complete line in the code. From the , after Value
Last edited by Sintek; 05-15-2017 at 10:22 AM.
Attached file
Stupid me, P15 is actually M16 . I am really sorry for this rookie error. It works now. I really do appreciate your time and effort and sorry to have wasted your time.
This is the line I now have.
Please Login or Register to view this content.
Last edited by A440; 05-15-2017 at 10:36 AM.
The value for your prints is in M16 not P15
Glad you noticed: Thanks for rep points
BTW, is there code to make the printer only print on one side? I have my printer set to print both sides by default.
No, I don't think you can do this through vba, see this post from Andy Pope who suggest setting up a second copy of the same printer, and set that instance to print one-sided. P.S. thanks for the rep
Many thanks
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks