Post by NFho colorato alcune celle che devono essere compilate ma vorrei che non
fossero colorate nella stampa.
E' possibile?
Ho visto la stessa domanda nell'ng:
it.comp.lang.visual-basic
Presumo quindi tu voglia fare questa cosa da codice vba.
Avvia il registratore delle macro e poi
esegui:
File-->Imposta pagina
Linguetta: Foglio
Spunta: Bianco e nero
Se interrompi la registrazione, trovi in un modulo
il seguente codice:
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.787401575)
.RightMargin = Application.InchesToPoints(0.787401575)
.TopMargin = Application.InchesToPoints(0.984251969)
.BottomMargin = Application.InchesToPoints(0.984251969)
.HeaderMargin = Application.InchesToPoints(0.5)
.FooterMargin = Application.InchesToPoints(0.5)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
.PrintQuality = 600
.CenterHorizontally = False
.CenterVertically = False
.Orientation = xlPortrait
.Draft = False
.PaperSize = xlPaperA4
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = True
.Zoom = 100
.PrintErrors = xlPrintErrorsDisplayed
End With
La riga che ti interessa è questa:
.BlackAndWhite = True
Come vedi puoi, da codice, fare i settaggi
che trovi nelle finestre: imposta pagina, intestazione e piè di pagina,
stampa.
Puoi anche eliminare quelli che non ti interessano per avere
codice più snello:
With ActiveSheet.PageSetup
.BlackAndWhite = True
End With
o ancora:
ActiveSheet.PageSetup.BlackAndWhite = True
--
----------------------------
Mauro Gamberini