VBa - Quickest Way to put 0’s where these are duplicated

Sahil123

Well-known Member
Joined
Oct 31, 2011
Messages
673
Hi

i have a dataset where there could some duplicates

if the name and date matches then put a 0 in that row (only duplicated row)

eg
DateTime, Name, Location, Time, Time2, Subject, Time3

27/07/2020 09:00, Simon, London, 03:50:00, 01:00:00, English, 02:00:00

27/07/2020 09:00, Simon, Liverpool , 03:50:00, 01:00:00, English, 02:00:00

The data should in that example look like this


27/07/2020 09:00, Simon, London, 03:50:00, 01:00:00, English, 02:00:00

27/07/2020 09:00, Simon, Liverpool , 0, 0, English, 0

Hope this makes sense
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Hi Fluff - I have come across another stinker of an issue

In Column C I have the location which will be different however some location are grouped (I have another grouped table called group in another spreadsheet)

eh GroupedTable (location GroupedFolder\GroupData
Filename GroupedData.xlsx
GroupedTable is on sheet GroupedData


Ie

Birmingham - Group 1
Liverpool - Group 1
London - Group 2
Leicester - Group 3
Bradford - Group 2

I need to amend the code to also look at this table and where there is a match in datetime and Name (Like we currently have)
also look at whether the group location in the same group and only put 0 in the duplicates in that group

ie if Bham, Liverpool and London had same name and time - then keep 1 of the 1 the group 1 data an and put 0's in the other and keep London as that is in another group however if there was another Group 2 ieBradford then have the dups as 0

It's an additional lookup which is annoyingly frustrating as i have just realised the data aint right without doing it like this
 
Upvote 0
As an example - table will look like this

1595926680023.png
 

Attachments

  • 1595926655891.png
    1595926655891.png
    3.9 KB · Views: 0
Upvote 0
As this is now a totally different question, you will need to start a new thread.
 
Upvote 0
As this is now a totally different question, you will need to start a new thread.

thank you

I appreciate its different but its an addition to the existing code therefore would mean i would raise exact same question with applying the code you have already helped me with thankfully and i didnt want to generate another thread ir confuse or get told of for duplicating threads

I appreciate all your help - is there any chance you can help me withit on this thread but if you require me to re raise thread and add extra bit for you then i can do that too

again thankyou
 
Upvote 0
Please start a new thread as requested.
 
Upvote 0
Hi Fluff - you will be able to advise better for sure

i was thinking of adding an extra temp column at end of the data set column (AB) will be the column that will be at the end

have a vlookup formula to pull back Group and then do the concatenation check with adding thiscolumn in too

i would have preferred to add this column in memory but that aint a biggie and then just delete out that temp column

is that a better way of doing it?
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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