Hide value from cell when printing

ipbr21054

Well-known Member
Joined
Nov 16, 2010
Messages
5,224
Office Version
  1. 2007
Platform
  1. Windows
Happy New Year.
My goal is that i would like to have a value not shown in a specific cell & also with no borders etc for when i print.
The line of code supplied below is the issue i believe.

On Sheet1 i have values in cells which have black fonts & borders
These values are then copied & pasted to the worksheet PRINT LABELS

My problem is only cell E6 when pasted.
I have the PRINT LABLES worksheet cell E6 set as white font with no borders but when pasted its ignored each time.
It takes onboard the borders & font color from where it was copied.


Rich (BB code):
Sheets("Sheet1").Range("E6:J6").Copy Sheets("PRINT LABELS").Range("E5")
Sheets("Sheet1").Range("E7").Copy Sheets("PRINT LABELS").Range("E6")
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
This works for me but after Activate do i need to specify Sheets("PRINT LABELS") again ?

Rich (BB code):
Sheets("Sheet1").Range("E6:J6").Copy Sheets("PRINT LABELS").Range("E5")
Sheets("Sheet1").Range("E7").Copy
Sheets("PRINT LABELS").Activate
Sheets("PRINT LABELS").Range("E6").PasteSpecial Paste:=xlPasteValues
 
Upvote 0
Hi,

why not use

VBA Code:
Sheets("PRINT LABELS").Range("E6").Value = Sheets("Sheet1").Range("E7").Value

Or set the NumberFormat to not show the contents and set back after print like

VBA Code:
    Range("E6").NumberFormat = ";;;"
    'Print
    Range("E6").NumberFormat = "General"

Ciao,
Holger
 
Upvote 0
Solution
Thanks for that, i think i was thinking to hard.
I used the below.

Rich (BB code):
Sheets("PRINT LABELS").Range("E6").Value = Sheets("Sheet1").Range("E7").Value
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,007
Members
448,935
Latest member
ijat

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top