Find in list and add new record under (Excel-VBA)

CEDAKA

New Member
Joined
Dec 8, 2020
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
I have created a form in VBA which fills cells in an Excel sheet displayed as follows.

B3C3D3E3
Fiche de transmissionNuméro du documentNom du documentDate de réception
FicheNuméroNomDate
ABC-FDT-EPBT-00119010079-TSP-003-003Spécification Eclairage Public25/10/2020
ABC-FDT-EPBT-00219010079-TSP-003-003Spécification éclairage publique04/11/2020
ABC-FDT-LDD20-00219010079 -TSP -002-001Spécifications des cables MT Souterrains & Aérien Réseau 20kV
ABC -FDT -LDD20 -00119010079 -TSP -002-001Fiche1: Câble aéro souterrain 3 x 1 x 240 mm2 Al28/10/2020
ABC -FDT -LDD20 -00119010079 -TSP -002-001Fiche2: Câble aéro souterrain 1 x 120 mm2 Al28/10/2020
ABC -FDT -LDD20 -00119010079 -TSP -002-001Fiche3: Câble aéro AAAC 1 x 148 mm2 Al28/10/2020
ABC -FDT -LDD20 -00119010079 -TSP -002-001Fiche4: Câble aéro AAAC 1 x 54,6 mm2 Al28/10/2020
ABC -FDT -LDD20 -00219010079 -TSP -002-001Fiche3: Câble aéro AAAC 1 x 148 mm2 Al04/11/2020
ABC -FDT -LDD20 -00219010079 -TSP -002-001Fiche4: Câble aéro AAAC 1 x 54,6 mm2 Al04/11/2020
ABC - FDT - LDD11,6 - 00119010079 - TSP -002-002Spécifications des câbles MT Souterrains & Aérien Réseau 11,6V
ABC - FDT - LDD11,6 - 00119010079 - TSP -002-002Fiche1 : Câble aéro soutérrain 1 x 120 mm2 Al28/10/2020
ABC - FDT - LDD11,6 - 00119010079 - TSP -002-002Fiche2 : Câble aéro AAAC 1 x 54,6 mm2 Al28/10/2020
ABC - FDT - LDD11,6 - 00219010079 - TSP -002-002Fiche2 : Câble aéro AAAC 1 x 54,6 mm2 Al04/11/2020
ABC - FDT - CAB20 -00119010079 - TSP -002-005Spécifications des Transformateurs MT/ BT Poste Triplex28/10/2020
ABC - FDT - CAB20 -00219010079 - TSP -002-005Spécifications des Transformateurs MT/ BT Poste Triplex Rev104/11/2020

As you could observe, "Numéro de document" repeats itself.
I would like that whenever I enter the same "Numéro de document" and that I validate the form, the code finds it in column C3 and inserts the row under.
More else, if this "Numéro de document" does not exist, it inserts the row at the end of the list

Could you advise?

Thanks in advance
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Tell VBA all new data placed at the next empty row followed the list and do a sorting on "Numéro de document" after your input.
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,196
Members
449,072
Latest member
DW Draft

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top