Some times we have some information in worksheet which is we need to input but do not want that information to be printed. With the following macro code you can achieve the desired results
You will need to
copy this code to workbook module of your workbook
Private Sub Workbook_BeforePrint(Cancel As Boolean) Application.EnableEvents = False Cancel = True A = Range("A1").NumberFormat Range("A1").NumberFormat = ";;;" Application.Dialogs(xlDialogPrint).Show Range("A1").NumberFormat = A Application.EnableEvents = True
End Sub
|
As per above code the contents of Range A1 will not be printed, you will need to change this reference to your cell.
Download file with the code to hide cell contents before printing
.
Doesn't exactly work for me. I'm trying to hide a range of cells in a sheet (e.g. B7-D9). I tried the code:
ReplyDeleteRange("B7:D9").NumberFormat = ";;;"
But that didn't work.
Hello Chris
ReplyDeleteI hope that you have enabled macros. Macros needs to be enabled to have this working.
If you have macros enabled, make sure that it has been added to workbook module of your file.
Also you will need to change the reference range at 3 places but this should not impact hiding contents. I suggest that you download file available at download link of the post and then change the refernce range to see how this works.
Again make sure that you have enabled macros.
Thanks
Yogesh Gupta
myself Ravishankar in our office we get a report from oracle based software like on sorted and its taking hell out my time pls help me out to do the same if you can suggest me
ReplyDeleteHi Ravi
ReplyDeleteI am not clear on what do you want. Can you be more specific about your question.
Regards//Yogesh Gupta
Hi Yogesh
ReplyDeleteactually we using oracle software and we getting daily reports which in un sorted condition with extra lines which is taking too much time for me to sort and analyzing the report
so can you help in this...
Hi Ravi
ReplyDeleteI can suggest some thing if I know the exact details of problem along with the resolution you want for it. What ever you have said is very generic and can not be commented upon for soultion
Regards//Yogesh Gupta
Yogesh one of my office mate locked excel file and he left job we keep trying to contact him and not responsing for anything, Pls not the spread sheet total file locked, means when we try to open the file Excel prompting the password
ReplyDeletePls help since this contain my full year finance data
Hi Ravi
ReplyDeleteI will not be able to help you with problem relating to password protection of the file.
Regards//Yogesh Gupta
How to hide multiple cells from printing? eg F$, E19, G54 etc
ReplyDeleteexactly what I needed. Just wish I could make it work in the macro-enabled worksheet. when i print preview, it still shows the content of the cell i am trying to hide. i wonder since this is module 2, if module 1 needs to run first? Module 1 is making lower case letters to caps automatically when clicking an assigned radio button. I am not a coder so I am only guessing that "private" means that this macro won't show up in the list to assign to a button. rather it will run automatically. No?
ReplyDeleteHi Marianne
ReplyDeleteYou need to copy the module above to workbook module. Kindly see link in this post above how to copy this code to workbook module.
Thanks
i almost got it I feel. Thanks for prompting me to read that again. I don't know why a Module2 kept opening, but now I was able to add the code to ThisWorkbook. I've changed A1 to D22 in all 3 places. When I print preview, the contents of D22 still show. Maybe it won't show when I actually print it, but I don't want to waste paper and ink. Plus, I would think print preview would show exactly what the worksheet would look like when printed. Again, the content of that cell is still showing. I know I'm close. I wish I could show you screenshots to show that I did copy your code right and how the print preview still shows the cell contents. If I change the cell format to ";;;" then I can't see the contents while working on the worksheet. I believe your code DOES allow one to see the cell value but when printing it, the cell is blank. What I have is a time sheet on a windows tablet. I want to be able to have a cell that shows how much I make in a month, but i don't want to have to change the cell format every time I want to see the contents of cell D22. I have a formula in cell D22. But when I print it to turn into my supervisor, I don't want the amount to show (even though the supervisor will figure the amount anyway). It is just for my information. I searched and found your code. Exactly what I needed. You posted this code way back in 2010, so I appreciate your reply to my post.
DeleteDoes this code work in tables in Microsoft Word?
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteOn the "Number" tab, select Category = "Custom" and for "Type" enter:
ReplyDelete"";"";"";""
On the "Number" tab, select Category = "Custom" and for "Type" enter:
ReplyDelete"";"";"";""
n the "Number" tab, select Category = "Custom" and for "Type" enter:
ReplyDelete"";"";"";""
Digital printing in bright attractive colors, prominent formats and stylized way of presentation entice the customers and are enthralling for the clients as well. parkplaceprinting
ReplyDeleteA rumored flyer printing Delhi administrations attempts to keep up first class guidelines with a specific end goal to make your promoting efforts viable.economic brochures
ReplyDeleteIs there a way to trigger an auto email to go out once a certain amount hits a spreadsheet? For example, I'm tracking several items on inventory. Once they hit a specific number, the word "order" automatically populates. I'd like an email to automatically go to the person who would then place the order. Is that possible? Thank you! - deadmen
ReplyDeleteWhatever be the message the client wants to put up to the customers, the printing industry takes care to handle it in the exact way they want it.Cheap Online Printing
ReplyDeleteThis is additionally a decent post which I truly delighted in perusing. It is only one out of every odd day that I have the likelihood to see something like this..
ReplyDeleteCheapest Printing Services Near Me
Office printing procedure - Small amounts each time, Eight information sheets, one organization profile sheet and one envelope, 1000 envelopes are printed just once,VSL
ReplyDeleteAcquiring your own machine to influence shading duplicates to can be expensive at first. While you can get singular duplicate machines, which arrive in a wide assortment of characteristics, you can likewise get multifunctional printer copiers which will likewise enable you to do similar things and the sky is the limit from there. cheapest color copies printing
ReplyDelete
ReplyDeleteI think this is a really good article. You make this information interesting and engaging. You give readers a lot to think about and I appreciate that kind of writing.
Luxury printing
I m no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that.
ReplyDeleteVehicle Signs Shropshire
To be positive that you have properly reversed the image, print a copy and put it in front of a mirror. This is the way it will look on your personalized t-shirt. gifts for companies
ReplyDeleteFirst You got a great blog .I will be interested in more similar topics. i see you got really very useful topics, i will be always checking your blog thanks. prototyp
ReplyDeleteEveryone has a business card, but not every business card is memorable. Printing technology has evolved to the point that you can now order business cards with pop-ups, cutouts, translucent overlays, and many other features. A business card that doesn't stand out won't be remembered, so plan the design of your business card carefully before you order business card printing. Leeds printers
ReplyDeleteBusiness card printing is a classic marketing strategy that one would think would always be successful. But if you don't know the ins and outs of this promotional component, you may be wasting your time creating business cards. In this day and age, business card printing is much more than a way to swap contact information; it's a way to make a statement for your company. Printing Services Leeds
ReplyDeleteYou have a genuine capacity for composing one of a kind substance. I like how you think and the way you speak to your perspectives in this article. I concur with your mindset. Much obliged to you for sharing. cheap every door direct mail® print (eddm®)
ReplyDeleteThis blog through it words has given a key to proficiency.
ReplyDeletefree reverse cell phone lookup
Such matter may be a bit complicated, but know just exactly what kind of printing services you are getting for your money when you've acquired a printer.best cheap 3d printer
ReplyDeleteI really loved reading your blog. It was very well authored and easy to undertand. Unlike additional blogs I have read which are really not tht good. I also found your posts very interesting. In fact after reading, I had to go show it to my friend and he ejoyed it as well! Custom Stickers
ReplyDeleteAll things considered, since your present clients are spending less, the best activity is increment your customer base. This is a lot actually quite difficult. הדפסה על מוצרים
ReplyDeletei wanted to leave a little comment to support you and wish you a good continuation. wishing you the best of luck for all your blogging efforts.
ReplyDeleteCustom Packaging Boxes
Hi! Great work. I feel nice to be here reading your authentic work.
ReplyDeleteCustom Sticker
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThat is an especially wonderful powerful resource that you’re giving and you merely give it here, thanks. hp officejet pro 6970 setup
ReplyDeletewebroot antivirus activation code
ReplyDeleteRenew Norton with Product Key
activate my mcafee product key
healey1234@gmail.com
ReplyDeleteCustom Boxes
Great Information sharing ..
I am very happy to read this
article .. thanks for giving
us go through info. Fantastic
nice. I appreciate this post.
and thank you for sharing
an amazing article…and Thank
you For Sharing
.
https://www.healeypackaging.co.uk
What’s Happening i’m new to this, I stumbled upon this I’ve discovered It absolutely useful and it has helped me out loads. I’m hoping to contribute & aid other customers like its helped me. Good job.
ReplyDeletePrinted Labels
Sticker Printing Press
Get Instant Printing Company
Good but i have problem for responsive Google+ comment on my website Soap boxes
ReplyDeleteWow, What an Excellent post. I really found this too much information. It is what I was searching for.I would like to suggest you that please keep sharing such type of info. Printing services in Long Beach
ReplyDeleteWow, What an Excellent post. I really found this too much information. It is what I was searching for.I would like to suggest you that please keep sharing such type of info. Advertising Printing company in qatar
ReplyDeleteIf you have any issue while setting up HP Printer, you can contact us for instant solution, just dial our toll-free number 8668690554 and contact our experts.
ReplyDeleteThanks for sharing
ReplyDeletePMP certification cost in india
Some truly wonderful work on behalf of the owner of this internet site , perfectly great articles . Custom Boxes USA
ReplyDeleteI will not be able to help you with problem relating to password protection of the file.
ReplyDeletenew birthday wishes
This blog is amazing keep sharing quality custom boxes
ReplyDeletevery fast and great service Customized Packing Box Company
best birthdays wishes i like it new birthday wishes
I will not be able to help you with problem relating to password protection of the file.
ReplyDeleteCustom Packaging Boxes