gordonc068
New Member
- Joined
- Feb 8, 2016
- Messages
- 12
All,
I am building a new hire form in excel and for audit purposes when we print certain information needs to be redacted. The best way I've come up with so far is to make a macro that will:
1. select the cells I want to change
2. change font color to the same as the background
3. print active sheet
4. select the same cells
5. change font color back to black
I tried to record such a marco but it isn't capturing the print portion of the cycle. Do you either; have a way for the recorder to pick up the print action or, write a macro with those items?
The below is what was recorded, note the lack of a print action. To print I went to file and chose print, is there a different way that it would pick up?
Sub Macro4()
'
' Macro4 Macro
'
'
Range("C10:C14,G9").Select
Range("G9").Activate
With Selection.Font
.Color = -52
.TintAndShade = 0
End With
Range("C10:C14,G9").Select
Range("G9").Activate
With Selection.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
Range("D10").Select
End Sub
I am building a new hire form in excel and for audit purposes when we print certain information needs to be redacted. The best way I've come up with so far is to make a macro that will:
1. select the cells I want to change
2. change font color to the same as the background
3. print active sheet
4. select the same cells
5. change font color back to black
I tried to record such a marco but it isn't capturing the print portion of the cycle. Do you either; have a way for the recorder to pick up the print action or, write a macro with those items?
The below is what was recorded, note the lack of a print action. To print I went to file and chose print, is there a different way that it would pick up?
Sub Macro4()
'
' Macro4 Macro
'
'
Range("C10:C14,G9").Select
Range("G9").Activate
With Selection.Font
.Color = -52
.TintAndShade = 0
End With
Range("C10:C14,G9").Select
Range("G9").Activate
With Selection.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
Range("D10").Select
End Sub