vba for NOT PRINTING WHATS IN A CELL

bamaisgreat

Well-known Member
Joined
Jan 23, 2012
Messages
821
Office Version
  1. 365
Platform
  1. Windows
I am trying to print a spreadsheet without it printing the text that is in a specific cell. I am currently using the macro below but would like this added if possible. the specific cell i do not want the text to print is P7.
Code:
Sub ArchiveIt()
Dim NR As Long
    NR = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
    
    Sheets("Sheet2").Range("A" & NR).Value = Sheets("BURN").Range("B5").Value
    Sheets("Sheet2").Range("B" & NR).Value = Sheets("BURN").Range("J4").Value
    Sheets("Sheet2").Range("C" & NR).Value = Sheets("BURN").Range("B7").Value
    Sheets("Sheet2").Range("D" & NR).Value = Sheets("BURN").Range("J5").Value
    Sheets("Sheet2").Range("E" & NR).Value = Sheets("BURN").Range("B6").Value
    Sheets("Sheet2").Range("F" & NR).Value = Sheets("BURN").Range("J6").Value
    Sheets("Sheet2").Range("G" & NR).Value = Sheets("BURN").Range("L16").Value
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
        IgnorePrintAreas:=False
        Range("c11").Select
    Selection.ClearContents
End Sub
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
The code below is activated by a cmd button
Code:
Sub ArchiveIt()
Dim NR As Long
    NR = Sheets("Sheet2").Range("A" & Rows.Count).End(xlUp).Row + 1
    
    Sheets("Sheet2").Range("A" & NR).Value = Sheets("BURN").Range("B5").Value
    Sheets("Sheet2").Range("B" & NR).Value = Sheets("BURN").Range("J4").Value
    Sheets("Sheet2").Range("C" & NR).Value = Sheets("BURN").Range("B7").Value
    Sheets("Sheet2").Range("D" & NR).Value = Sheets("BURN").Range("J5").Value
    Sheets("Sheet2").Range("E" & NR).Value = Sheets("BURN").Range("B6").Value
    Sheets("Sheet2").Range("F" & NR).Value = Sheets("BURN").Range("J6").Value
    Sheets("Sheet2").Range("G" & NR).Value = Sheets("BURN").Range("L16").Value
        ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True, _
        IgnorePrintAreas:=False
        Range("c11").Select
    Selection.ClearContents
End Sub
could this be affecting the reason the text is still printing out
 
Upvote 0

Forum statistics

Threads
1,214,990
Messages
6,122,625
Members
449,093
Latest member
catterz66

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