Boa tarde, Marcelo Prudencio.
Agradeço seu empenho, mas o erro ainda persiste considerando sua sugestão. Quando executo a macro pela primeira vez apresenta a mensagem de erro, daí clico em Ok, contudo, nas demais vezes que executo a macro esta tudo normal. O erro aparece apenas na primeira execução da macro ao abrir a planilha.
Segue código alterado com o mesmo erro:
Sub Limpar()
'
' Limpar Macro
'
'
Sheets("Objetivos").Range("B5:M6, B9:M43, B45:M45, Q6:AO17").ClearContents
Sheets("Jan").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("Fev").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("Mar").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("Abr").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("Mai").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("Jun").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("Jul").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("Ago").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("Set").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("Out").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("Nov").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("Dez").Range("D6:J29, N6:P29, V6:AQ39, AI1, AO1:AO2").ClearContents
Range("D6").Select
Sheets("PDD").Range("A3:E69, G3:I69, A80:E113, G80:I113").ClearContents
Rows("3:69").Select
Range("A69").Activate
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Rows("80:113").Select
Range("A113").Activate
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Range("A3").Select
Sheets("Ajuizamentos").Range("A6:I300").ClearContents
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
With Selection.Font
.ThemeColor = xlThemeColorLight1
.TintAndShade = 0
End With
ActiveWindow.ScrollRow = 6
Range("A6").Select
Sheets("Objetivos").Select
ActiveWindow.SmallScroll Down:=-42
Range("B5").Select
End Sub
Postado : 08/10/2016 10:38 am