Boa tarde senhores, não estou conseguindo acertar o comando em que Eu na Plan3 atraves do formulario userforms exclua uma linha na Plan6
Private Sub BtExcluirAud_Click()
On Erro GoTo Erro
Dim linha As Integer
ult_linha = Worksheets("Plan6").Cells(rowns.Count, "A").End(xlUp).Row
If Worksheets("Plan6").Cells(linha, 18).Value = valor_processo Then
Worksheets("Plan6").Range(Worksheets("Plan6").Cells(linha, 1), Worksheets("Plan6").Cells(linha, 42)).Delete Shift:=xlUp
linha = linha - 1
End If
valor_processo = Txt_Processo_Aud.Value
ult_linha = Range("A30000").End(xlUp).Row
For linha = 2 To ult_linha
If Cells(linha, 18).Value = valor_processo Then
Range(Cells(linha, 1), Cells(linha, 42)).Delete Shift:=xlUp
linha = linha - 1
End If
Next
ActiveWorkbook.Save
MsgBox "Cadastro do cliente " & Me.Txt_Cliente_Aud & " foi EXCLUIDO com sucesso!", vbInformation, "Excluído!"
Unload Audiência
Exit Sub
Erro:
MsgBox "Erro!", vbCritical, "ERRO"
End Sub