macro to remove duplicate lines and correct the data 2 columns

atditiljazi

New Member
Joined
Nov 22, 2022
Messages
41
Office Version
  1. 365
Platform
  1. Windows
hi guys,

Because of the way the warehouse guys book the goods in, my system at work splits the orders into multiple lines. I need the macro to identify the split lines and replace them with a single line so that the qty ordered in column K and Receipt Quantity in column L is correct. Is there a way a macro can do this? sheet now is currently called sheet2.

1694101403892.png
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
atd Let's get the ball rolling. I am guessing that below is an example of what you want for an output. If not let us know.

23-09-07 combine.xlsm
ABCDEFGHIJKLMN
11supplier Event Receipt Dateformance DateOrder NumberItem NumberDescQuantity OrderedReceipt QuantitycommeiF
22sample a30/8/202330/8/20230On TimePO498461Q4224RM KUKUI NUT OIL OILS OF ALOHA HOO50.050.0
33sample b7/8/20237/8/20230On TimePO479473AS683RM BIO-SIGNAL LIPID10 MB . HO2.02.0
44sample c14/8/202314/8/20230On TimePO481984A0957RM HYALURONIC ACID-BT . HOO10.010.0
5sample cD057/8/20237/8/20230On TimePO488456av375RM ALPAFLOR ALP-SEBUM CB . HO9.03.0
68sample c14/8/202314/8/20230On TimePO488452A1822RM MARINE 20669LNZ HOO10.010.0
79sample cD0221/8/202318/8/20233On TimePO488451A2699RM LIPONIC EG-1 . H2S226.8226.8
Sheet1 (8)
 
Upvote 0
Try the following on a copy of your workbook:
VBA Code:
Sub ZapDupes()
    Worksheets("Sheet2").Range("A1").CurrentRegion.RemoveDuplicates _
    Columns:=Array(7, 9, 10), Header:=xlYes
End Sub
 
Upvote 0

Forum statistics

Threads
1,215,084
Messages
6,123,021
Members
449,092
Latest member
ikke

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