Help with Code Flattening a Excel Document to Remove Duplicate Records

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
Johnny
Posts: 2
Joined: 10 Jan 2018 10:30

Help with Code Flattening a Excel Document to Remove Duplicate Records

#1 Post by Johnny » 10 Jan 2018 10:43

Hello all,

I am very new to creating batch files and or macros to run to manipulate data and files so any help would be grateful. Thanks in advace for your time

I have an Excel Document that needs to be flattened. There are multiple records containing different account information in columns H,I,J,K but the information in A through G is exactly the same. What I need is a script that would combine or merge all the duplicate fields giving me one record for each name.

Example

Data formatted as such

sheet workbook name is Mail File

FirstName, LastName,123 Main St,APT 2, Anywhere,US,22222,2012,LUMP SUM,BONUS,$55,000
FirstName, LastName,123 Main St,APT 2, Anywhere,US,22222,2013,SystemPay,BaseSalary,$55,000

End Goal

FirstName, LastName,123 Main St,APT 2, Anywhere,US,22222, 2012,LUMP SUM,BONUS,$55,000,2013,SystemPay,BaseSalary,$55,000


Johnny

Squashman
Expert
Posts: 4486
Joined: 23 Dec 2011 13:59

Re: Help with Code Flattening a Excel Document to Remove Duplicate Records

#2 Post by Squashman » 10 Jan 2018 12:39

Sounds like you need a VBA macro. That is out of scope for DosTips.com. We mostly handle .bat (batch) files and some jscript and vbscript. Batch files cannot manipulate Excel files. Vbscript, Jscript and Powershell can to some extent edit excel files but you would probably be better off with a VBA macro.

Johnny
Posts: 2
Joined: 10 Jan 2018 10:30

Re: Help with Code Flattening a Excel Document to Remove Duplicate Records

#3 Post by Johnny » 11 Jan 2018 04:59

Thank you for your response. I will explore your recommendations and explore the VBA macro options.

Post Reply