Is there a way not to print a specific word or cell
-
- SilverLounger
- Posts: 1868
- Joined: 25 Jan 2010, 14:00
- Location: Conroe, Texas
Is there a way not to print a specific word or cell
Is there a way not to print a specific word or cell? using code or not. Let say I have the word spot in cell A1 that I want to leave on my sheet but do not wish to have it print.
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Is there a way not to print a specific word or cell
You could set the text color of the cell(s) to the same as the fill (background) color. This will make the text invisible both on screen and in a printout.
Alternatively, you could hide the row or column containing the cell.
Alternatively, you could hide the row or column containing the cell.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 689
- Joined: 27 Jan 2010, 16:45
- Location: Ottawa, Ontario, Canada
Re: Is there a way not to print a specific word or cell
One approach using code would be to:ABabeNChrist wrote:Is there a way not to print a specific word or cell? using code or not. Let say I have the word spot in cell A1 that I want to leave on my sheet but do not wish to have it print.
- copy the sheet to a new sheet
- do a search and replace on the new sheet, replacing the word or phrase of interest with nothing ("")
- print the new sheet
- delete the new sheet
Regards
Don
Don
-
- Administrator
- Posts: 7209
- Joined: 15 Jan 2010, 22:52
- Location: Middle of England
Re: Is there a way not to print a specific word or cell
I don't think that will work when printing in 'Black and white' mode - certainly not in my Excel 2002...HansV wrote:You could set the text color of the cell(s) to the same as the fill (background) color. This will make the text invisible both on screen and in a printout.
Leif
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Is there a way not to print a specific word or cell
No, in B&W mode, Excel will print the text even if it is white...
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 1868
- Joined: 25 Jan 2010, 14:00
- Location: Conroe, Texas
Re: Is there a way not to print a specific word or cell
I first attemped in using
This is not exactly what I was hoping for. I was hoping to format a single cell so that text would and could be visible but would not print. Like a form control, you can see it but you don’t have to print it. This way printing would not necessarily need code to hide text
Code: Select all
With ActiveSheet
.Range("A1").Value = ""
.PrintOut
.Range("A1").Value = "Spot"
End With
-
- Administrator
- Posts: 78524
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Is there a way not to print a specific word or cell
That is not possible, so you'll have to use a workaround.ABabeNChrist wrote:I was hoping to format a single cell so that text would and could be visible but would not print.
Best wishes,
Hans
Hans
-
- SilverLounger
- Posts: 1868
- Joined: 25 Jan 2010, 14:00
- Location: Conroe, Texas
Re: Is there a way not to print a specific word or cell
I guess a workaround it is
Thank you Hans, Don and Leif
Thank you Hans, Don and Leif
-
- Administrator
- Posts: 12612
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: Is there a way not to print a specific word or cell
Another workaround might be to insert a borderless white rectangle in front of the cellABabeNChrist wrote:I guess a workaround it is...
Code: Select all
Dim shp As Shape
With ActiveSheet.Range("D4")
Set shp = ActiveSheet.Shapes.AddShape(msoShapeRectangle, .Left, .Top, .Width, .Height)
End With
shp.Fill.ForeColor.RGB = RGB(255, 255, 255)
shp.Line.Visible = msoFalse
StuartR
-
- SilverLounger
- Posts: 1868
- Joined: 25 Jan 2010, 14:00
- Location: Conroe, Texas
Re: Is there a way not to print a specific word or cell
Thank you StuartR
thats not a bad idea
I will weight out all my options and see what works best in my application
thats not a bad idea
I will weight out all my options and see what works best in my application
-
- StarLounger
- Posts: 78
- Joined: 18 Feb 2010, 01:44
Re: Is there a way not to print a specific word or cell
A custom number format of ";;;" hides a cell entry without altering the cell contents.
You can use the workbook Before Print event code to format the cell(s), print the sheet and then revert to the original number format.
'---
Jim Cone
Portland, Oregon USA
https://goo.gl/IUQUN2" onclick="window.open(this.href);return false; (Dropbox)
(free and commercial excel workbooks & add-ins)
You can use the workbook Before Print event code to format the cell(s), print the sheet and then revert to the original number format.
'---
Jim Cone
Portland, Oregon USA
https://goo.gl/IUQUN2" onclick="window.open(this.href);return false; (Dropbox)
(free and commercial excel workbooks & add-ins)