For Each Row in Range

pwill

Active Member
Joined
Nov 22, 2015
Messages
406
Hi can anyone help with a macro or line of code that I can add to another macro?

I have data in "E4:K4"
and "E5:K26" Sheet1

For Each Row in Range
"E5:K26" if any Value is the same as any value in
Range "E4:K4" and the Count of the same Values For Each Row that Match/Duplicate any Value in
"E4:K4"
is 1 then clear the duplicate cell for each row when the Count is only 1 (or less than 2)

ie

ABCDEFGHIJKL
1
2
3
41234567
5213321081912
6435570231520
71116187404628
8173245857822
93127368362776
101234567

<colgroup><col span="13"></colgroup><tbody>
</tbody>


Row "E5:K5" has a Count of 1 Value that is the same in
"E4:K4"
Row "E6:K6" has a Count of 2 Values that are the same in "E4:K4"
<strike>
</strike>
Row "E7:K7" has a Count of 1 Value that is the same in "E4:K4"
Row "E8:K8" has a Count of 2 Values that are the same in "E4:K4"
Row "9:K9" has a Count of 1 Value that is the same in "E4:K4"
<strike>
</strike>
Row "E10:K10" has a Count of 7 Values that are the same in "E4:K4"

So the results would be
G5 = Nothing
H7 =
Nothing
K9 =
Nothing
ABCDEFGHIJKL
1
2
3
41234567
521331081912
6435570231520
7111618404628
8173245857822
9312736836277
101234567

<colgroup><col span="13"></colgroup><tbody>
</tbody>
<strike>
</strike>
Any help would be much appreciated

Regards

pwill
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Forum statistics

Threads
1,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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