+ Reply to Thread
Results 1 to 26 of 26

Formating data to view better

  1. #1
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Formating data to view better

    Hi,

    On the attached spreadsheet I need help to format the data to look better. Since the data is in tabular format I am finding so much time to format manually on the Parked report tab. I have also added sample Format tab with the column header and the below sample data it should appear like.

    Please help with macro or functions.

    Regards,
    Vijay
    Attached Files Attached Files
    Last edited by vijanand1279; 10-30-2012 at 03:13 AM.

  2. #2
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Could you help me on this.

  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: Formating data to view better

    Hi Vijay

    The code in the attached works on your sample file...test it on a COPY of your live file. Let me know of issues.
    Attached Files Attached Files
    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
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Hi John

    The attached file works fine but when I am trying to copy the data from the attached text file and paste in A1 to run the macro it shows me an error.

    could you please why this is hapenning.
    Attached Files Attached Files

  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: Formating data to view better

    Hi Vijay

    The structure of the pasted data is different from the structure of your original sample file, therefore the macro fails. Is your newest .txt file what the structure will ALWAYS look like?

  6. #6
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Hi John

    Yes this is how the structure will look always.

    REgards,
    Vijay

  7. #7
    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: Formating data to view better

    Hi Vijay

    This is a major rewrite to clean up the Raw Data so it can be parsed. I'm traveling from this afternoon until Sunday evening. I'll get back to you.

  8. #8
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Formating data to view better

    hi vijanand1279, though it's pretty ungrateful to deal with such sort of tasks I would give it a try, please check attachment, press "Get data" button on Sample Format sheet and select txt file to process.
    The code has been polished to process data in the provided txt file correctly though there might be errors on other nearly similar files with different layout
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Hi John


    Could you help me on this .

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Formating data to view better

    Quote Originally Posted by jaslake View Post
    Hi Vijay

    This is a major rewrite to clean up the Raw Data so it can be parsed. I'm traveling from this afternoon until Sunday evening. I'll get back to you.
    member said they will be back sunday evening
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  11. #11
    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: Formating data to view better

    Hi Vijay

    Have you tested watersev's code? I ran it on your new book and it appears to perform flawlessly.

  12. #12
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Hi Watersev,

    Yes this is really awesome...I tried to run the report and it worked perfect. Thank you so much.

    I was trying this to create a macro by recording the steps in excel. But it never worked for me. I think I have to learn other ways to create a macro instead of recording all time.

    Thank you....

  13. #13
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Hi John,

    Yes it is working fine. I tried to run it in with multiple reports and it works fine.

  14. #14
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Hi Watersev,

    I tried to run the macro with the new report. But I am seeing some missing items from the original text file attached....I have saved the missing items in the seperate text file attached. Also the first row with 380.41- is actually a credit but it is showing as 380.41 after executing the macro. So any credit entry on the text report is showing as positive (Debit) amount.

    Please help on the above bug.

    Regards,
    Vijay

  15. #15
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Quote Originally Posted by vijanand1279 View Post
    Hi Watersev,

    Yes this is really awesome...I tried to run the report and it worked perfect. Thank you so much.

    I was trying this to create a macro by recording the steps in excel. But it never worked for me. I think I have to learn other ways to create a macro instead of recording all time.

    Thank you....
    Help me with the bug....

  16. #16
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Hi

    Could you check on the above bug and help me. Not sure why some of the items are missing from the original and also the credit amount shows in positive.

    Regrds,
    Vijay

  17. #17
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Formating data to view better

    please check attachment, the code was updated to clear any data prior to new output
    Attached Files Attached Files

  18. #18
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    It looks to be working fine now. I see the credit amount also picking up as it is. But the total doesn't match when I do a sum for all the rows. When I change the minus symbol to prefix for the entire credit amount the grand total amount matches with the original total amount...

    Is it possible to see the invoice amount contains hyphen (Credit) and have the hyphen in the front of the invoice amount?

  19. #19
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Formating data to view better

    please check attachment
    Attached Files Attached Files

  20. #20
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    This is working fine. I am sorry for late response. Because I had to wait till today to check on new report. This is real time saver.

  21. #21
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Hi Watersev,

    I am getting "subscript out of range" errro.

    Run-Time error '9':

    Subscript out of range.

    Please help. I am attaching the spreadsheet and the text file.

    Regards,
    Vijay
    Attached Files Attached Files

  22. #22
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Could you help me on this debug.

  23. #23
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Formating data to view better

    please check attachment, txts are the files it was tested on
    Attached Files Attached Files
    Last edited by watersev; 11-28-2012 at 05:11 AM.

  24. #24
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    It looks fine now. Why was it throwing subscript out of range error. Is there a method that we could prevent from such type debug. I am not sure what is causing an error.

    Please help me to understand better.

    Regards,
    Vijay

  25. #25
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Formating data to view better

    you post sample file that does not represent all possible data patterns. In this particular case the problem was non-standard opening line:

    Standard in all previous sample files:
    SVCS EXECUTIVES CLUB OF CHICAGO 2059 1105

    Non-standard causing error:
    SVCS FRONTIER

    I can not guess what it might be the other time. So the root is data consistency or forsee all possible data patterns. The other way is to ignore any error though that might be a bumpy way as reports will have errors you do not know of.
    Last edited by watersev; 11-28-2012 at 05:20 PM.

  26. #26
    Forum Contributor
    Join Date
    01-05-2011
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    243

    Re: Formating data to view better

    Thank you. I also noticed the difference in the line opening the report. Hope I don't get any different format reports.

    This is really working fine and a time-saver too.

+ 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