Respostas criadas no fórum
-
AutorArtigos
-
albino10Participante
<span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Boa tarde senhores,</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Acredito que falta poucos paara eu concluir meu projeto VBA.</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Preciso de um comando que direcione o botão excluir a linha para plan(6) desejada, no momento só consigo excluir a linha estando na mesma plan(6). Preciso estar na Plan(3) e excluir uma terminada linha na Plan(6). Esse é o comando que tenho:</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Private Sub BtExcluirAud_Click()</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>On Erro GoTo Erro</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Dim confirmar As String</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>confirmar = MsgBox(“Tem certeza que deseja EXCLUIR o Cliente: ” & Me.Txt_Cliente_Aud & “?”, vbYesNo, “Excluir!”)</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>If confirmar = vbNo Then</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>MsgBox “Exclusão do Cliente: ” & Me.Txt_Cliente_Aud & ” CANCELADO!”, vbInformation, “Exclusao cancelada!”</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Unload Audiência</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Exit Sub</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>End If</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>valor_processo = Txt_Processo_Aud.Value</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>ult_linha = Range(“A30000″).End(xlUp).Row</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>For linha = 2 To ult_linha</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>If Cells(linha, 18).Value = valor_processo Then</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Range(Cells(linha, 1), Cells(linha, 42)).Delete Shift:=xlUp</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>linha = linha – 1</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>End If</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Next</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>ActiveWorkbook.Save</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>MsgBox “Cadastro do cliente ” & Me.Txt_Cliente_Aud & ” foi EXCLUIDO com sucesso!”, vbInformation, “Excluído!”</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Unload Audiência</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Exit Sub</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>Erro:</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>MsgBox “Erro!”, vbCritical, “ERRO”</span><br style=”box-sizing: border-box; color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;” /><span style=”color: #303e41; font-family: ‘Source Sans Pro’, Arial, Helvetica, sans-serif; font-size: 14px;”>End Sub</span>
albino10Participantereenviando o arquivo
-
AutorArtigos