Help with pseudocode translated into VBA Code

Z

Zuzeppeddu

Hi
I need help with translating this pseudocode into VBA Code. I have a
spreadsheet (37000 records) with the following columns:

CustomerNo (Column B), ServiceDesc (Column E), OpenDate (Column F)

I have to spot the duplicates in the CustomerNo and based on that
perform the following:

IF CustomerNo IS DUPLICATED THEN

IF Within the DUPLICATED CustomerNo Records: ServiceDesc IS
DUPLICATED AND OpenDate IS DUPLICATED AND TIME DIFFERENCE BETWEEN
DUPLICATED OpenDate records IS GREATER THAN OR EQUAL TO 15 MINS THEN

DELETE the DUPLICATE(S) based on CustomerNo

END IF

END IF


I don't have to physically delete the duplicates but mark them as
delete whilst keeping any of the duplicate records.

Any help will be very much appreciated. If you can just start me off
with some basic VBA code that should be enough. I'll amend the code
based on trial and error.

Thanks.

ps. I know this pseudocode is not strictly pseudocode but hope it will
help you understand the issue.
 
D

Don Guillett Excel MVP

Hi
I need help with translating this pseudocode into VBA Code. I have a
spreadsheet (37000 records) with the following columns:

CustomerNo (Column B), ServiceDesc (Column E), OpenDate (Column F)

I have to spot the duplicates in the CustomerNo and based on that
perform the following:

IF CustomerNo IS DUPLICATED THEN

    IF Within the DUPLICATED CustomerNo Records: ServiceDesc IS
DUPLICATED AND OpenDate IS DUPLICATED AND TIME DIFFERENCE BETWEEN
DUPLICATED OpenDate records IS GREATER THAN OR EQUAL TO 15 MINS THEN

         DELETE the DUPLICATE(S) based on CustomerNo

END IF

END IF

I don't have to physically delete the duplicates but mark them as
delete whilst keeping any of the duplicate records.

Any help will be very much appreciated. If you can just start me off
with some basic VBA code that should be enough. I'll amend the code
based on trial and error.

Thanks.

ps. I know this pseudocode is not strictly pseudocode but hope it will
help you understand the issue.

"If desired, send your file to dguillett @gmail.com I will only look
if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top