probleme VBA programming

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
 

Forum statistics

Threads
69,482
Messages
909,936
Members
239,751
Latest member
afshin.dehghani1

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu