Clovis Leite Junior Postado Junho 29, 2017 Denunciar Share Postado Junho 29, 2017 Boa noite pessoal. Bom não entendo muita coisa de VBA, mas criei um botao para inserir uma linha acima e puxar as confirgurações dessa linha. Segue como ficou e o erro que aparece: Sub LINHAS() ' ' LINHAS Macro ' ' Range("A31:S31").Select Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove - ESSE E O ERRO Range("A30:S30").Select Selection.AutoFill Destination:=Range("A30:S31"), Type:=xlFillDefault Range("A30:S31").Select ActiveWindow.SmallScroll Down:=25 Range("AA51").Select ActiveWindow.ScrollColumn = 10 ActiveWindow.ScrollColumn = 9 ActiveWindow.ScrollColumn = 8 ActiveWindow.ScrollColumn = 7 ActiveWindow.ScrollColumn = 6 ActiveWindow.ScrollColumn = 5 ActiveWindow.ScrollColumn = 4 ActiveWindow.ScrollColumn = 3 ActiveWindow.ScrollColumn = 2 ActiveWindow.ScrollColumn = 1 Range("A51:AA51").Select Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove Range("A50:AA50").Select Selection.AutoFill Destination:=Range("A50:AA51"), Type:=xlFillDefault Range("A50:AA51").Select ActiveWindow.ScrollColumn = 9 ActiveWindow.ScrollColumn = 8 ActiveWindow.ScrollColumn = 7 ActiveWindow.ScrollColumn = 6 ActiveWindow.ScrollColumn = 5 ActiveWindow.ScrollColumn = 4 ActiveWindow.ScrollColumn = 3 ActiveWindow.ScrollColumn = 2 ActiveWindow.ScrollColumn = 1 ActiveWindow.ScrollRow = 30 ActiveWindow.ScrollRow = 29 ActiveWindow.ScrollRow = 28 ActiveWindow.ScrollRow = 27 ActiveWindow.ScrollRow = 26 ActiveWindow.ScrollRow = 25 ActiveWindow.ScrollRow = 24 ActiveWindow.ScrollRow = 23 ActiveWindow.ScrollRow = 22 ActiveWindow.ScrollRow = 21 ActiveWindow.ScrollRow = 20 ActiveWindow.ScrollRow = 19 ActiveWindow.ScrollRow = 18 ActiveWindow.ScrollRow = 17 ActiveWindow.ScrollRow = 16 ActiveWindow.ScrollRow = 15 ActiveWindow.ScrollRow = 14 ActiveWindow.ScrollRow = 13 ActiveWindow.ScrollRow = 12 ActiveWindow.ScrollRow = 11 ActiveWindow.ScrollRow = 10 ActiveWindow.ScrollRow = 11 ActiveWindow.ScrollRow = 10 ActiveWindow.ScrollRow = 9 ActiveWindow.ScrollRow = 8 ActiveWindow.ScrollRow = 7 ActiveWindow.ScrollRow = 6 ActiveWindow.ScrollRow = 5 ActiveWindow.ScrollRow = 4 ActiveWindow.ScrollRow = 3 ActiveWindow.ScrollRow = 2 ActiveWindow.ScrollRow = 1 ActiveWindow.ScrollRow = 11 ActiveWindow.ScrollRow = 9 ActiveWindow.ScrollRow = 8 ActiveWindow.ScrollRow = 6 ActiveWindow.ScrollRow = 5 ActiveWindow.ScrollRow = 4 ActiveWindow.ScrollRow = 3 ActiveWindow.ScrollRow = 2 ActiveWindow.ScrollRow = 1 Range("A18").Select End Sub então quando eu protejo a planilha acontece esse erro acima. Erro em tempo de execução 1004. Por favor quem puder me ajudar agradeço. Obrigado Citar Link para o comentário Compartilhar em outros sites More sharing options...
Pergunta
Clovis Leite Junior
Boa noite pessoal.
Bom não entendo muita coisa de VBA, mas criei um botao para inserir uma linha acima e puxar as confirgurações dessa linha.
Segue como ficou e o erro que aparece:
Sub LINHAS()
'
' LINHAS Macro
'
'
Range("A31:S31").Select
Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove - ESSE E O ERRO
Range("A30:S30").Select
Selection.AutoFill Destination:=Range("A30:S31"), Type:=xlFillDefault
Range("A30:S31").Select
ActiveWindow.SmallScroll Down:=25
Range("AA51").Select
ActiveWindow.ScrollColumn = 10
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("A51:AA51").Select
Selection.EntireRow.Insert , CopyOrigin:=xlFormatFromLeftOrAbove
Range("A50:AA50").Select
Selection.AutoFill Destination:=Range("A50:AA51"), Type:=xlFillDefault
Range("A50:AA51").Select
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
ActiveWindow.ScrollRow = 30
ActiveWindow.ScrollRow = 29
ActiveWindow.ScrollRow = 28
ActiveWindow.ScrollRow = 27
ActiveWindow.ScrollRow = 26
ActiveWindow.ScrollRow = 25
ActiveWindow.ScrollRow = 24
ActiveWindow.ScrollRow = 23
ActiveWindow.ScrollRow = 22
ActiveWindow.ScrollRow = 21
ActiveWindow.ScrollRow = 20
ActiveWindow.ScrollRow = 19
ActiveWindow.ScrollRow = 18
ActiveWindow.ScrollRow = 17
ActiveWindow.ScrollRow = 16
ActiveWindow.ScrollRow = 15
ActiveWindow.ScrollRow = 14
ActiveWindow.ScrollRow = 13
ActiveWindow.ScrollRow = 12
ActiveWindow.ScrollRow = 11
ActiveWindow.ScrollRow = 10
ActiveWindow.ScrollRow = 11
ActiveWindow.ScrollRow = 10
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 7
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
ActiveWindow.ScrollRow = 11
ActiveWindow.ScrollRow = 9
ActiveWindow.ScrollRow = 8
ActiveWindow.ScrollRow = 6
ActiveWindow.ScrollRow = 5
ActiveWindow.ScrollRow = 4
ActiveWindow.ScrollRow = 3
ActiveWindow.ScrollRow = 2
ActiveWindow.ScrollRow = 1
Range("A18").Select
End Sub
então quando eu protejo a planilha acontece esse erro acima. Erro em tempo de execução 1004.
Por favor quem puder me ajudar agradeço.
Obrigado
Link para o comentário
Compartilhar em outros sites
0 respostass a esta questão
Posts Recomendados
Participe da discussão
Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.