atrix002
New member
- Jul 29, 2022
- 1
- 0
- 3
Hello wonderful people
I have a problem about programming
The delete command is not working
Can you help please
this program is for editing invoices
and when I modify an invoice,
there is a help sheet to keep the invoice to be modified and the invoice in the sales sheet must be deleted and replaced by the invoice in the help sheet
the code VBA in excel
Dim fr1, fr2, lr1, lr1 As Integer
lr1 = Feuil2.Range("A10000").End(xlUp).Row
lr2 = Feuil6.Range("A").End(xlUp).Row
For fr1 = 2 To lr1
For fr2 = 2 To lr2
If Feuil2.Cells(fr1, "A").Text = Me.Textnbrfc.Text And _
Feuil2.Cells(fr1, "D").Value = Feuil6.Cells(fr2, "A").Value Then
''Feuil2.Range("A:L").EntireRow.Delete
Feuil2.Range("A:L").Delete
lr1 = lr1 + 1
lr2 = lr2 + 1
End If
Next
Next
I have a problem about programming
The delete command is not working
Can you help please
this program is for editing invoices
and when I modify an invoice,
there is a help sheet to keep the invoice to be modified and the invoice in the sales sheet must be deleted and replaced by the invoice in the help sheet
the code VBA in excel
Dim fr1, fr2, lr1, lr1 As Integer
lr1 = Feuil2.Range("A10000").End(xlUp).Row
lr2 = Feuil6.Range("A").End(xlUp).Row
For fr1 = 2 To lr1
For fr2 = 2 To lr2
If Feuil2.Cells(fr1, "A").Text = Me.Textnbrfc.Text And _
Feuil2.Cells(fr1, "D").Value = Feuil6.Cells(fr2, "A").Value Then
''Feuil2.Range("A:L").EntireRow.Delete
Feuil2.Range("A:L").Delete
lr1 = lr1 + 1
lr2 = lr2 + 1
End If
Next
Next