Este fórum está sendo desativado

Depois de 9 anos, este fórum será desativado. Mas calma.... estamos migrando para uma comunidade no DISCORD. Junte-se a nós.

ENTRAR PARA DISCORD

Tópicos relacionados a códigos VBA, gravação de macros, etc.
  • Avatar do usuário
#73232
Olá senhores, preciso de ajuda para desenvolver o comando que EXCLUA linhas somente nas colunas específicas, ou seja, nas colunas: "D" até "J" e de "T" até "Z" acho que estou perto mas porue informa que excluiu com sucesso mas as linhas continuam lá, veja abaixo:
Private Sub BtExcluirCob_Click()
On Erro GoTo Erro
Dim confirmar As String
Plan4.Activate
Dim plan As String
plan = Plan4.Name

confirmar = MsgBox("Tem certeza que deseja EXCLUIR o Cliente: " & Me.Txt_Cliente_Cob & "?", vbYesNo, "Excluir!")
If confirmar = vbNo Then
MsgBox "Exclusão do Cliente: " & Me.Txt_Cliente_Cob & " CANCELADO!", vbInformation, "Exclusao cancelada!"
Unload Audiência
Exit Sub
End If

valor_Processo = TXT_ID.Value
ult_linha = Range("T3000").End(xlUp).Row
For linha = 2 To ult_linha
If Cells(linha, 18).Value = valor_Processo Then
Plan4.Range(Cells(linha, 1), Plan6.Cells(linha, 9)).Delete Shift:=xlUp
Plan4.Range(Cells(linha, 94), Plan6.Cells(linha, 97)).Delete Shift:=xlUp

'ActiveWorkbook.Save
MsgBox "Cadastro do cliente " & Me.Txt_Cliente_Cob & " foi EXCLUIDO com sucesso!", vbInformation, "Excluído!"

Unload Cobrança
Exit Sub
Erro:
MsgBox "Erro!", vbCritical, "ERRO"

End Sub
long long title how many chars? lets see 123 ok more? yes 60

We have created lots of YouTube videos just so you can achieve [...]

Another post test yes yes yes or no, maybe ni? :-/

The best flat phpBB theme around. Period. Fine craftmanship and [...]

Do you need a super MOD? Well here it is. chew on this

All you need is right here. Content tag, SEO, listing, Pizza and spaghetti [...]

Lasagna on me this time ok? I got plenty of cash

this should be fantastic. but what about links,images, bbcodes etc etc? [...]

Estamos migrando para uma comunidade no Discord