Notifications
Clear all

Erro de compilação

2 Posts
2 Usuários
0 Reactions
1,683 Visualizações
(@vonzuben)
Posts: 549
Prominent Member
Topic starter
 

Erro de compilação (número de argumentos incorretos ou atribuição de propriedade inválida)

'--- Variavel ---
Linha = Target.Row

If Range("I" & Linha).Value = "LIMPAR" Then
    
    Range("B" & Linha & ":" & "E" & Linha, "G" & Linha, "I" & Linha).SpecialCells(xlCellTypeConstants).ClearContents

End If

O motivo do erro é pq estou limpando a célula LIMPAR ?

Obrigado !

 
Postado : 17/10/2018 12:39 pm
(@fernandofernandes)
Posts: 43750
Illustrious Member
 

Voce está querendo utilizar duas ranges em uma unica sentença

voce pode experimentar (sem testar por motivo obvio):

Range("B" & Linha & ":" & "E" & Linha).SpecialCells(xlCellTypeConstants).ClearContents
Range("G" & Linha, "I" & Linha).SpecialCells(xlCellTypeConstants).ClearContents

ou ainda

Union(Range("B" & Linha & ":" & "E" & Linha), Range("G" & Linha, "I" & Linha)).SpecialCells(xlCellTypeConstants).ClearContents
 
Postado : 17/10/2018 1:41 pm