Is it possible to hide certain digits when printing in excel?, for example the cell will show: A/O(1) but when viewing the printed version I would like the cell to show A/O
Hi
AFAIK this is not possible. You could create a macro which would do the
following:
- use a helper column which shows only the relevant part of your data
- hides the original column
- prints the sheet
- unhides the original column
- deletes the helper column
Assuming 1) you want to hide everything after the first "(", 2) the cell
background colors are automatic (or white), and 3) the fonts are the
default color:
Public Sub HideAndPrint()
Dim rCell As Range
Dim rConvert As Range
Dim rPR As Range
Dim nPos As Long
On Error Resume Next
Set rPR = Range("Print_Area")
If rPR Is Nothing Then Set rPR = ActiveSheet.UsedRange
On Error GoTo 0
For Each rCell In rPR
With rCell
nPos = InStr(.Text, "(")
If nPos > 0 Then
If rConvert Is Nothing Then
Set rConvert = .Cells
Else
Set rConvert = Union(rConvert, .Cells)
End If
.Characters(nPos).Font.ColorIndex = 2
End If
End With
Next rCell
ActiveSheet.PrintOut
For Each rCell In rConvert
With rCell
.Characters(InStr(.Text, "(")).Font.ColorIndex = xlAutomatic
End With
Next rCell
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.