Hi all..
I have a workbook with 3 sheets. On sheet 1 I have macro buttons 1 of which "prints/saves as pdf" the current/active sheet. I would like to add a button which "prints/saves as pdf" sheet 2. How is this possible please?
Thanks
Hi all..
I have a workbook with 3 sheets. On sheet 1 I have macro buttons 1 of which "prints/saves as pdf" the current/active sheet. I would like to add a button which "prints/saves as pdf" sheet 2. How is this possible please?
Thanks
Sure, can you post the code you have so far.
Dom
"May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."
Use code tags when posting your VBA code: [code] Your code here [/code]
Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.
Im sorry... Here it is
Please Login or Register to view this content.
It would be like this:
Please Login or Register to view this content.
Dom
Fandabby dozy - thank you.
I dont suppose you know how to specify a file name for it to save as? Not a file location just file name? Thanks
Can't test this but maybe:
Please Login or Register to view this content.
Dom
Thanks for trying, unfortunatly it still saves the pdf as the original workbook name
Odd I thought that would work. I assume you've saved the workbook before running the code?
Dom
Yeah I saved it, even closed it down and then reopend it. The code is as below:
Please Login or Register to view this content.
Nearly, I'd called the variable strFileName:
Please Login or Register to view this content.
Dom
Ah ha!! Cool that works fine... Thanks..
I notice you can name the pdf based on a cell content, is it possible to append a cell field infront of the "\test1.pdf" so it would read "\test1-cellcontent.pdf"?
Thanks
Like this:
Please Login or Register to view this content.
Dom
Exactly like that only it didnt work, Ive got my str's in place this time
Please Login or Register to view this content.
It will be picking the cell info up from cell A1 on the active worksheet. Is this how you have it set up?
Dom
Excuse my utter stupidity I accidently labled the cell with nothing in it - doh. Works perfectly thanks
No worries. Please mark the thread Solved if you're happy with the solution.
Dom
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks