Notifications
Clear all
2024 - VBA & Macros
2
Posts
2
Usuários
0
Reactions
1,739
Visualizações
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
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
Existem mil maneiras de preparar Neston. Invente a sua!
http://www.youtube.com/ExpressoExcel
Postado : 17/10/2018 1:41 pm