Notifications
Clear all

[Resolvido] Botão Alterar

1 Posts
1 Usuários
0 Reactions
200 Visualizações
(@francisco-junior)
Posts: 1
New Member
Topic starter
 

Boa Noite, fiz um userforme e o botão alterar não altera, podem me ajudar, segue código que fiz.

 

Sheets("INFORMAÇÕES APARELHO").Visible = True
Sheets("SISTEMA").Visible = False

Dim resposta As VbMsgBoxResult
Dim valor As Long
Dim fila As Object
Dim Linha As Long

Me.ComboBoxCLIENTE.Enabled = False

If Me.TextBoxID.Value = "" Then
MsgBox "Selecione um cadastro para alterar!"
Exit Sub
End If

valor = Me.TextBoxID.Value
resposta = MsgBox("Deseja alterar o cadastro Nº" & valor & "?", vbYesNo)

If resposta = vbNo Then
Exit Sub

Else

Set fila = Worksheets("INFORMAÇÕES APARELHO").Range("A:AR").Find(valor, lookat:=xlWhole)
Linha = fila.Row

'fim

Range("A" & Linha).Value = Me.TextBoxID.Value

Range("I" & Linha).Value = Me.TextBoxCNPJ.Value

Range("A" & Linha).Value = Me.TextBoxID.Value
Range("B" & Linha).Value = Me.TextBoxRESPONSAVEL.Value
Range("C" & Linha).Value = Me.ComboBoxCLIENTE.Value
Range("D" & Linha).Value = Me.TextBoxENDEREÇO.Value
Range("E" & Linha).Value = Me.TextBoxBAIRRO.Value
Range("F" & Linha).Value = Me.TextBoxCIDADE.Value
Range("G" & Linha).Value = Me.TextBoxUF.Value
Range("H" & Linha).Value = Me.TextBoxTEL.Value
Range("I" & Linha).Value = Me.TextBoxCNPJ.Value
Range("J" & Linha).Value = Me.TextBoxINSCEST.Value
Range("K" & Linha).Value = Me.TextBoxEMAIL.Value
Range("L" & Linha).Value = Me.ComboBoxTIPOAP.Value
Range("M" & Linha).Value = Me.TextBoxNºFABRICAÇÃO.Value
Range("N" & Linha).Value = Me.ComboBoxMARCAAPARELHO.Value
Range("O" & Linha).Value = Me.TextBoxPAVPERCORRIDOS.Value
Range("P" & Linha).Value = Me.TextBoxPERCURSO.Value
Range("Q" & Linha).Value = Me.ComboBoxMANOBRA.Value
Range("R" & Linha).Value = Me.TextBoxLOTAÇÃO.Value
Range("S" & Linha).Value = Me.TextBoxCARGA.Value
Range("T" & Linha).Value = Me.TextBoxNºPARADAS.Value
Range("U" & Linha).Value = Me.TextBoxVELOCIDADE.Value
Range("V" & Linha).Value = Me.TextBoxPOTENCIA.Value
Range("W" & Linha).Value = Me.TextBoxDIMENSÕESCABINE.Value
Range("X" & Linha).Value = Me.TextBoxPESOCABINE.Value
Range("Y" & Linha).Value = Me.TextBoxPESOCONTRAPESO.Value
Range("Z" & Linha).Value = Me.TextBoxNºCABOS.Value
Range("AA" & Linha).Value = Me.TextBoxDIAMETRODOSCABOS.Value
Range("AB" & Linha).Value = Me.TextBoxTIPOTRAÇÃO.Value
Range("AC" & Linha).Value = Me.ComboBoxAPSEGURANÇA.Value
Range("AD" & Linha).Value = Me.ComboBoxTIPOPP.Value
Range("AE" & Linha).Value = Me.ComboBoxTIPOPC.Value
Range("AF" & Linha).Value = Me.ComboBoxTRANSMISSÃO.Value
Range("AG" & Linha).Value = Me.ComboBoxSAIDAEM.Value
Range("AH" & Linha).Value = Me.ComboBoxAPANHARCARGA.Value
Range("AI" & Linha).Value = Me.TextBoxARTINSTALAÇÃO.Value
Range("AJ" & Linha).Value = Me.TextBoxDATAINSTALAÇÃO.Value
Range("AK" & Linha).Value = Me.ComboBoxTIPOFREIO.Value
Range("AL" & Linha).Value = Me.ComboBoxELEVEMERGENCIA.Value
Range("AM" & Linha).Value = Me.TextBoxCODLOG.Value
Range("AN" & Linha).Value = Me.TextBoxNºIMOVEL.Value
Range("AO" & Linha).Value = Me.TextBoxNºART.Value
Range("AP" & Linha).Value = Me.TextBoxDATAVALIDADEARTINSTALAÇÃO.Value
Range("AQ" & Linha).Value = Me.TextBoxCREAINSTALADORA.Value
Range("AR" & Linha).Value = Me.TextBoxDATAINSTALAÇÃO.Value

 
Postado : 31/07/2024 8:36 pm