Olá tenho esse código. Estou com um problema, a partir do IF com Elétrica o código era para adicionar o que estava na TextBox1 na coluna respectiva a Elétrica, só que o código como consegui fazer só escreve na mesma célula subscrevendo cada vez que tentar usar ele. Na parte Interligação Frigorífica ele funciona como deveria. Gostaria de ajuda de como resolver isso.
Private Sub CommandButton1_Click() If TextBox1.Value = "" Then Exit Sub End If If ComboBox1.Value = "" Then Exit Sub End If If ComboBox1.Value = "INTERLIGAÇÃO FRIGORÍFICA" Then Dim varA As Variant With Sheets("teste 1").Cells(Rows.Count, 1).End(xlUp) .Offset(1, 0).Value = TextBox1.Text End With varA = Sheets("teste 1").Range("L7").Value If varA <= 0 Then Label3.Caption = "Consumo dentro do orçado" ElseIf varA > 0 Then Label3.Caption = "Consumo além do orçado em " & Format(varA, "Currency") End If ComboBox1.ListIndex = -1 TextBox1.Text = "" End If If ComboBox1.Value = "ELÉTRICA" Then Dim varB As Variant With Sheets("teste 1").Cells(Rows.Count, 1).End(xlUp) .Offset(1, 1).Value = TextBox1.Text End With varB = Sheets("teste 1").Range("L8").Value If varB <= 0 Then Label3.Caption = "Consumo dentro do orçado" ElseIf varB > 0 Then Label3.Caption = "Consumo além do orçado em " & Format(varB, "Currency") End If ComboBox1.ListIndex = -1 TextBox1.Text = "" End If End Sub