I have few code numbers written in sheet1 col. A
I want code that can 1) search for code written in sheet1 col. A in sheet2 Col.A
and if found delete full row from sheet2.
Request members of this forum to guide me
I have few code numbers written in sheet1 col. A
I want code that can 1) search for code written in sheet1 col. A in sheet2 Col.A
and if found delete full row from sheet2.
Request members of this forum to guide me
As your expected result does not match your explanation …
Anyway you can try an easy Excel basics like an advanced filter in order to filter the rows to be deleted
like any Excel beginner operating manually so without the need of any VBA procedure …
Last edited by Marc L; 03-12-2022 at 07:11 AM.
I want to delete rows in one click(i,e, using macro)
I don't want to delete rows one by one.
please guide.
As your expected result does not match your explanation …
And my previous post is just about deleting all filtered rows at once like any Excel user can operate easily without any VBA procedure !
Last edited by Marc L; 03-12-2022 at 07:11 AM.
by mistake I have written sheet 1 instead of sheet2 and sheet2 instead of sheet1 of sheet1 in my question.
sorry for inconvenience.
Please guide.
can someone help![]()
Did you give it a try at least to the Excel basics easy advanced filter ? Should be achieved in around ten seconds,
so faster than creating a thread on any forum and faster than creating a procedure …
If a VBA procedure is really necessary just activating the Macro Recorder before operating in order to get your own code base.
As your expected result does not exactly match your explanation
so it will be such a good idea to post an attachment - saved as .xlsb - without any error in the expected result at least …
Last edited by Marc L; 03-12-2022 at 07:28 AM.
I have few code numbers written in sheet2 col. A
I want code that can 1) search for code written in sheet2 col. A in sheet1 Col.A
and if found delete full row from sheet1.
Request members of this forum to guide me
(Reason why I want to use macro is that there are many supporting macros and excel formulas used in excel work book. Sheet1 contains
basis input data for all supporting macros and VLOOKUP formulas I want above mentioned macro to update basic input data
in sheet1 by deleting matching codes. so that other supporting macros can give updated output. attached file is just a samplefile for creating
macro mentioned above only)
See if the attached works for you
As a reminder according to the Excel basics advanced filter and the Macro Recorder less than ten codelines is necessary …
So just operating manually an advanced filter less than 10 seconds is necessary to delete the filtered rows at once,
the reason why I never had the need to create any VBA procedure for such easy and basic operation …
When a procedure is really necessary - never met the case - so just activating the Macro Recorder to get a good starting point …
According to post #8 attachment for starters :
PHP Code:
Sub Macro1()
With [Sheet1!A1].CurrentRegion.Rows
.AdvancedFilter 1, [Sheet2!A1].CurrentRegion.Columns(1)
If Application.Subtotal(103, .Columns(1)) > 1 Then .Item("2:" & .Count).Delete xlShiftUp
.Parent.ShowAllData
End With
End Sub
► Do you like it ? ► ► So thanks to click on bottom left star icon « ★ Add Reputation » ! ◄ ◄
In addition how to know if a VBA procedure is good enough ?
Run it, check the result and if it is the expected one, run a second time the same VBA procedure even if it's not needed,
the result must be the same without any error message …
@AB33 : Thanks. with few modifications your code is giving desired results. I am happy that you have solved my problem in just one reply.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks