+ Reply to Thread
Results 1 to 17 of 17

Reformatting columns, creating files, and totalling organized data

  1. #1
    Registered User
    Join Date
    09-10-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2003
    Posts
    8

    Reformatting columns, creating files, and totalling organized data

    Hey guys. I am an IT tech at a company. Unfortunately I never had any experience with creating macros or visual basic, and as a result of both of our programming guys disappearing this week, I've had a lot of work dumped on my shoulders. One thing my boss has asked me to do is alter this file, creating a bunch of macros (I believe? It doesn't seem like I've been able to create substitute formulas to work for the first part dealing with LName FName MI). I was wondering if there was anyone out there who could help me with this. I've uploaded the xls file (It reads much better in .csv extension though) and I'll list what I've been asked to do. I'm not necessarily asking anyone to do this for me, but I have 2 other tasks I've been asked to complete, one in Java, one in SQL and learning them on top of macros has been rather intense. Any insight or redirection to a reliable source to quickly teach me would be greatly appreciated, thank you!

    2) reformat the 'Name' column to have 'Last Name, First Name Middle Initial.'
    3) reformat birthdays to be YYYYMMDD
    4) output reformatted data to a file called : 'cleandata.<time stamp YYYYMMDD_HHMMSS>.csv'
    5) have output sorted alphabetically by state, then by name
    6) any duplicates account numbers should be rejected and noted
    7) produce a secondary report named 'summaryreport.<time stamp YYYYMMDD_HHMMSS>.txt' with :
    - total balances aggregated by state
    - there is a column "Favorites". List the top five favorites and the number of times
    they appear.
    Attached Files Attached Files
    Last edited by madfrog; 09-10-2010 at 01:52 PM. Reason: bad original title

  2. #2
    Registered User
    Join Date
    09-10-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Reformatting columns, creating files, and totalling organized data

    Up to the top - any insight???

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Reformatting columns, creating files, and totalling organized data

    Hi madfrog

    The file you attached appears to be a coma delimited text file. Is this indeed what your data looks like?

    John
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    09-10-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Reformatting columns, creating files, and totalling organized data

    Hey jaslake,

    I believe so. If you change the file extension to .csv, it will open in Excel and appear like a regular excel file, which is how I received it. I simply changed the file extension to .xls so it could be uploaded to the website. It does seem like each column is separated by a comma in the coding though.

    Cheers!
    Ben

  5. #5
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Reformatting columns, creating files, and totalling organized data

    Hi madfrog

    In the event someone else is working on this, 02/29/1974 is NOT a valid date. Apparently 1974 was NOT a leap year. Just a heads up.

    John

  6. #6
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Reformatting columns, creating files, and totalling organized data

    Hi madfrog

    If duplicate Account Numbers exist what do you want to happen? Should BOTH be rejected and noted? Or should only one be rejected and noted?

    John

  7. #7
    Registered User
    Join Date
    09-10-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Reformatting columns, creating files, and totalling organized data

    Thanks for the heads up John. I think it might just be a mistype and it should be 2/28. Anyone else have any insight?

    Ben

  8. #8
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Reformatting columns, creating files, and totalling organized data

    Hi Ben

    Working on it as we speak. What about this question
    If duplicate Account Numbers exist what do you want to happen? Should BOTH be rejected and noted? Or should only one be rejected and noted?
    John

  9. #9
    Registered User
    Join Date
    09-10-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Reformatting columns, creating files, and totalling organized data

    Hey John!

    Only one should be noted. Much appreciated!

    Cheers
    Ben

  10. #10
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Reformatting columns, creating files, and totalling organized data

    Hi Ben

    Attached is the first draft. It accomplishes these items:
    1. reformat the 'Name' column to have 'Last Name, First Name Middle Initial.'
    2. reformat birthdays to be YYYYMMDD
    3. output reformatted data to a file called : 'cleandata.<time stamp YYYYMMDD_HHMMSS>.XLS (note the fie extension)
    4. have output sorted alphabetically by state, then by name
    5. any duplicates account numbers should be rejected and noted
    6. produce a secondary report named 'summaryreport.<time stamp YYYYMMDD_HHMMSS>.XLS (note the file extension) with total balances aggregated by state
    7. there is a column "Favorites". List the top five favorites and the number of times they appear.
    There are some formatting issues but I'd like you to see if I'm on the right track.

    John
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    09-10-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Reformatting columns, creating files, and totalling organized data

    Hey John,

    Everything's looking great so far. Thanks so so much!

    Ben

  12. #12
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Reformatting columns, creating files, and totaling organized data

    Hi Ben

    Well, I've broken it. I'll fix the problem but let me know what else you see that needs changed.

    John

  13. #13
    Registered User
    Join Date
    09-10-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Reformatting columns, creating files, and totalling organized data

    John,

    The only thing I noticed is the summary report balances not being aggregated by state. Honestly what you've done has been of so much help. Thank you so much!

    Ben

  14. #14
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Reformatting columns, creating files, and totalling organized data

    Hi Ben

    Well, I've fixed that. I've another issue with duplicate records. An incorrect record appears to be deleted. I'm on top of it. Get back to you.

    John

  15. #15
    Registered User
    Join Date
    09-10-2010
    Location
    Connecticut
    MS-Off Ver
    Excel 2003
    Posts
    8

    Re: Reformatting columns, creating files, and totalling organized data

    Hey John,

    Great, thanks so much!

    Ben

  16. #16
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Reformatting columns, creating files, and totalling organized data

    Hi Ben

    I've been over this version pretty throughly. I'd like you to beat it up and see if you can break it. Also, let me know what further enhancements you require.

    I'll continue to look at it; if i see issues, I'll let you know. Please do the same.

    John
    Attached Files Attached Files

  17. #17
    Registered User
    Join Date
    08-01-2010
    Location
    American in Rovereto, Italy
    MS-Off Ver
    Excel 2010 home & Excel 2010 work
    Posts
    46

    Re: Reformatting columns, creating files, and totalling organized data

    I also wrote a program to help Madfrog AKA Ben.

    This one lets the user chosse the CSV data file and then writes a text file for each report.

    Gordon
    Attached Files Attached Files
    Gordon in Rovereto, Italy

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1