The following macro does the job of printing. But when returning from printing or when the printout was cancelled, an error message box comes out with "Object Require" on it. I need to do reset some cells format which obviosly I can not.
Public Sub IMPRIMIR()
fila = ActiveCell.Row
col = ActiveCell.Column
Dim Resp As String
Range("b1:I67").Select
With Selection.Interior
.Pattern = xlNone
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
Resp = MsgBox("Desea Imprimir ?", vbYesNoCancel, "IMPRIMIR")
If Resp = "6" Then
ActiveSheet.PrintPreview
End If
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent3
.TintAndShade = 0.599993896298105
.PatternTintAndShade = 0
End With
Range("c4:h5,c7:h9,B12:i21,b27:i66").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent3
.TintAndShade = 0.799981688894431
.PatternTintAndShade = 0
End With
Range("b2:i2,b11:i11,b24:i26,b67:i67").Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent3
.TintAndShade = -0.499984740745262
.PatternTintAndShade = 0
End With
With Selection.Font
.ThemeColor = xlThemeColorDark2
.TintAndShade = 0
End With
Active.cell(fila, col).Select
End Sub
Help will be appreciated.
Thanks
Necalabria
Bookmarks