After all,
I have made my workbook not visible so the user will only be able to use userforms BUT i want to have a print preview OR print button that will print off a range on a worksheet.
STUCK!
Please note that on 14th December 2023 users will experience an expected outage whilst we make upgrades to our network. We anticipate this process may take a couple of hours and so we apologise in advance for any inconvenience.
After all,
I have made my workbook not visible so the user will only be able to use userforms BUT i want to have a print preview OR print button that will print off a range on a worksheet.
STUCK!
You could add a command button on the userform and change the caption to PRINT. In the code module for the command button insert the code to print the range when the command button is clicked.
You could add a command button on the userform and change the caption to PRINT. In the code module for the command button insert the code to print the range when the command button is clicked.
Yep already have a cmdbutton on the userform with the code to print preview BUT when the preview comes up excel hangs and i have to shut via task manger so i was thinking this has something to do with the workbook being hidden?
I don't know what is causing the problem. Maybe you can try adding code to make the workbook visible, print the range and then hide it again.
I don't know what is causing the problem. Maybe you can try adding code to make the workbook visible, print the range and then hide it again.
I did try this but being very new to VBA im not to sure if i got it write and upon searching the net dint find a great deal on it
I don't know if I can offer a solution, but without seeing your workbook it is difficult to see what is happening.
theres quite alot of my company data in the workbook now so i can share really, thanks anyway ill just have to keep trying different things until i hit lucky
You could delete all the confidential data and include only the range you want to print replacing the data with dummy information. Include the macros and userforms you are currently using.
Thanks Roy
That didnt work unfortunalty, im going to post the sheet up
So im trying to get a cmdbutton to print preveiw a certain sheet, when i can get one working ill also need it to create an email to which there is already a macro for
That works perfect thank you!!
You are very welcome.
Basically my code was to tell you how to use PrintPreview with a UserForm and will work. You simply need to make the application visible, as you would do if you use PrintPreview without a userform and make the application hidden.
Dont suppose i can use the same code to preview and send the email?
In a previous post you said that you already have an email macro. Can you post that code?
In a previous post you said that you already have an email macro. Can you post that code?
It in the sheet posted but ive been using the code in a module and using a button on the tabs see module 5
Cheers Mumps works lovely ill get the hang of this soon
Don’t have an account yet? Register yourself now and be a part of our community!