delete serial no match with item

majidsiddique

Board Regular
Joined
Oct 22, 2018
Messages
164
Hi All,

i have a data in below mention table. i want to remove column C (serial) MD-120100000015969 upto MD-14008000000025, not delete 27M888228, can it is possible excel select auto range and remove MD(No)? i am using PIVOT table but all serial are showing.


[TABLE="width: 476"]
<colgroup><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]item[/TD]
[TD]S.No[/TD]
[TD] serial [/TD]
[TD] lot[/TD]
[TD] expiry[/TD]
[TD]Qty[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 1[/TD]
[TD]MD-12010000000015969[/TD]
[TD] 2018040079[/TD]
[TD] 30/04/2021[/TD]
[TD] 1[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 2[/TD]
[TD]MD-12010000000015970[/TD]
[TD] 2018040079[/TD]
[TD] 30/04/2021[/TD]
[TD] 1[/TD]
[/TR]
[TR]
[TD]MD-120100000 [/TD]
[TD] 3[/TD]
[TD]MD-12010000000015971[/TD]
[TD] 2018040079[/TD]
[TD] 30/04/2021 [/TD]
[TD] 1[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 4[/TD]
[TD]MD-12010000000015972[/TD]
[TD] 2018040079 [/TD]
[TD]30/04/2021 [/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 5[/TD]
[TD]MD-12010000000015973[/TD]
[TD] 2018040079[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 6[/TD]
[TD]MD-12010000000015974[/TD]
[TD] 2018040079[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 7[/TD]
[TD]MD-12010000000015975[/TD]
[TD] 2018040079[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-14008000[/TD]
[TD]1[/TD]
[TD]MD-1400800000000021[/TD]
[TD]2018040444[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-14008000[/TD]
[TD]2[/TD]
[TD]MD-1400800000000022[/TD]
[TD]2018040444[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-14008000[/TD]
[TD]3[/TD]
[TD]MD-1400800000000023[/TD]
[TD]2018040444[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-14008000[/TD]
[TD]4[/TD]
[TD]MD-1400800000000024[/TD]
[TD]2018040444[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-14008000[/TD]
[TD] 5[/TD]
[TD]MD-1400800000000025[/TD]
[TD]2018040444[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 1[/TD]
[TD]27M888228[/TD]
[TD] [/TD]
[TD]28/02/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 2[/TD]
[TD]27M888658[/TD]
[TD] [/TD]
[TD]28/02/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 3[/TD]
[TD]27M889216[/TD]
[TD] [/TD]
[TD]28/02/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 4[/TD]
[TD]27M889576[/TD]
[TD] [/TD]
[TD]01/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 5[/TD]
[TD]27M889857[/TD]
[TD] [/TD]
[TD]01/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 6[/TD]
[TD]27M889890[/TD]
[TD] [/TD]
[TD]01/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 7[/TD]
[TD]27M889891[/TD]
[TD] [/TD]
[TD]01/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-585210000[/TD]
[TD] 1[/TD]
[TD]MD-58521000000000079[/TD]
[TD] 2018040195[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-585210000 [/TD]
[TD] 2[/TD]
[TD]MD-58521000000000080[/TD]
[TD] 2018040195[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-585210000[/TD]
[TD] 3[/TD]
[TD]MD-58521000000000081[/TD]
[TD] 2018040195[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-585210000[/TD]
[TD] 4[/TD]
[TD]MD-58521000000000082[/TD]
[TD] 2018040195[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-638RL2600[/TD]
[TD] 1[/TD]
[TD]26B961351[/TD]
[TD] [/TD]
[TD]28/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-638RL2600 [/TD]
[TD] 2[/TD]
[TD]26B961352[/TD]
[TD] [/TD]
[TD]28/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-638RL2600 [/TD]
[TD] 3[/TD]
[TD]26B961355[/TD]
[TD] [/TD]
[TD]28/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-638RL2600[/TD]
[TD] 4[/TD]
[TD]26B961356[/TD]
[TD] [/TD]
[TD]28/03/2023[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Item: MD-12010000 is a Column A, cell A1 but table are showing 2 row.


Hi All,

i have a data in below mention table. i want to remove column C (serial) MD-120100000015969 upto MD-14008000000025, not delete 27M888228, can it is possible excel select auto range and remove MD(No)? i am using PIVOT table but all serial are showing.


[TABLE="width: 476"]
<tbody>[TR]
[TD]item[/TD]
[TD]S.No[/TD]
[TD] serial[/TD]
[TD] lot[/TD]
[TD] expiry[/TD]
[TD]Qty[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 1[/TD]
[TD]MD-12010000000015969[/TD]
[TD] 2018040079[/TD]
[TD] 30/04/2021[/TD]
[TD] 1[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 2[/TD]
[TD]MD-12010000000015970[/TD]
[TD] 2018040079[/TD]
[TD] 30/04/2021[/TD]
[TD] 1[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 3[/TD]
[TD]MD-12010000000015971[/TD]
[TD] 2018040079[/TD]
[TD] 30/04/2021[/TD]
[TD] 1[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 4[/TD]
[TD]MD-12010000000015972[/TD]
[TD] 2018040079[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 5[/TD]
[TD]MD-12010000000015973[/TD]
[TD] 2018040079[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 6[/TD]
[TD]MD-12010000000015974[/TD]
[TD] 2018040079[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-120100000[/TD]
[TD] 7[/TD]
[TD]MD-12010000000015975[/TD]
[TD] 2018040079[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-14008000[/TD]
[TD]1[/TD]
[TD]MD-1400800000000021[/TD]
[TD]2018040444[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-14008000[/TD]
[TD]2[/TD]
[TD]MD-1400800000000022[/TD]
[TD]2018040444[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-14008000[/TD]
[TD]3[/TD]
[TD]MD-1400800000000023[/TD]
[TD]2018040444[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-14008000[/TD]
[TD]4[/TD]
[TD]MD-1400800000000024[/TD]
[TD]2018040444[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-14008000[/TD]
[TD] 5[/TD]
[TD]MD-1400800000000025[/TD]
[TD]2018040444[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 1[/TD]
[TD]27M888228[/TD]
[TD][/TD]
[TD]28/02/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 2[/TD]
[TD]27M888658[/TD]
[TD][/TD]
[TD]28/02/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 3[/TD]
[TD]27M889216[/TD]
[TD][/TD]
[TD]28/02/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 4[/TD]
[TD]27M889576[/TD]
[TD][/TD]
[TD]01/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 5[/TD]
[TD]27M889857[/TD]
[TD][/TD]
[TD]01/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 6[/TD]
[TD]27M889890[/TD]
[TD][/TD]
[TD]01/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-500DM2700[/TD]
[TD] 7[/TD]
[TD]27M889891[/TD]
[TD][/TD]
[TD]01/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-585210000[/TD]
[TD] 1[/TD]
[TD]MD-58521000000000079[/TD]
[TD] 2018040195[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-585210000[/TD]
[TD] 2[/TD]
[TD]MD-58521000000000080[/TD]
[TD] 2018040195[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-585210000[/TD]
[TD] 3[/TD]
[TD]MD-58521000000000081[/TD]
[TD] 2018040195[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-585210000[/TD]
[TD] 4[/TD]
[TD]MD-58521000000000082[/TD]
[TD] 2018040195[/TD]
[TD]30/04/2021[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-638RL2600[/TD]
[TD] 1[/TD]
[TD]26B961351[/TD]
[TD][/TD]
[TD]28/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-638RL2600[/TD]
[TD] 2[/TD]
[TD]26B961352[/TD]
[TD][/TD]
[TD]28/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-638RL2600[/TD]
[TD] 3[/TD]
[TD]26B961355[/TD]
[TD][/TD]
[TD]28/03/2023[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]MD-638RL2600[/TD]
[TD] 4[/TD]
[TD]26B961356[/TD]
[TD][/TD]
[TD]28/03/2023[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Here is a VBA solution.

Code:
Option Explicit


Sub DelMD()
    Dim i As Long, lr As Long
    lr = Range("C" & Rows.Count).End(xlUp).Row
    Application.ScreenUpdating = False
    For i = lr To 2 Step -1
        If InStr(Range("C" & i), "MD") > 0 Then
            Range("C" & i).ClearContents
        End If
    Next i
    Application.ScreenUpdating = True
End Sub

Standard Module
How to install your new code
Copy the Excel VBA code
Select the workbook in which you want to store the Excel VBA code
Press Alt+F11 to open the Visual Basic Editor
Choose Insert > Module
Edit > Paste the macro into the module that appeared
Close the VBEditor
Save your workbook (Excel 2007+ select a macro-enabled file format, like *.xlsm)


To run the Excel VBA code:
Press Alt-F8 to open the macro list
Select a macro in the list
Click the Run button
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,085
Members
452,378
Latest member
Hoodzy01

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