+ Reply to Thread
Results 1 to 35 of 35

Generate report from excel

  1. #1
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Generate report from excel

    Hi,

    I´m having a schoolproject where I´m creating a calculation program for hydraulic cylinders depending of what positions they have.
    What I want is that when calculations is done, I will be able to generate a report that automatic returns numbers from my calculations.
    I also want it to generate a different reportnumber each time a report is generated.

    When saving the report I would like it to be stored in a folder named as the reportnumber.
    Finally I want to be able to search for the report by use of a searchengine in my excel workbook.

    Does anybody have something similar to post me, or some tips to guide me on the way.

    Any ideas are much appreciated

    Best regards
    Oeysbrei

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    You will need to provide some more details on what needs to be done. A sample file will surely help.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    arlu1201,

    Thanks for youre reply, but my file is all in norwegian and contains a whole lot of unsorted data that only I know whats for.

    What I basicly want is a reportform that collects data from my workbook to be generated by pushing a button.
    When saving I would like it to be saved as a single file in a reportfolder.

    Oeysbrei

  4. #4
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: Generate report from excel

    This is me shooting from my hip, but that "whole lot of unsorted data" thing is probably the first big problem.

    If it were me, I would write a "template" xls, with a tab labeled "input" where you would copy-paste data in, and then a tab labeled "report" that would point to the data on the "input" tab.

    Saving a different name... would be accomplished by the user with the "save as" function.

    I mean, you could do all of this with a macro or something, but based on what you're saying, I'm not seeing where it would benefit you much to go to the bother of it.

  5. #5
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    I dont know if I should thank you for the reply, but I see that I could be more presise.
    I have attached the workbook where I´m gonna use the report
    If anybody have some sparetime, you could have a look at the file and see what I want in earlier posts.

    Thank you

    Regards
    Oeysbrei
    Attached Files Attached Files
    Last edited by Oeysbrei; 04-20-2012 at 04:00 PM.

  6. #6
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    Hi,

    Anybody?

  7. #7
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    Please wait atleast for a few hrs before bumping the post. I will look into it shortly.

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    Please mention what numbers you need to be output? What should your report contain? It will be good if you have a sample output tab that we can help you automate.

  9. #9
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    arlu1201,

    Thanks for youre reply.
    In the report I will collect data from differrent sheets, but for a start I will need the following data:

    Kalkulasjon Formelinput
    L3:L9 C17
    P13 I19:I24
    Q13 B20
    R3

    What I also need the report to contain, is the date that will be set automaticaly.
    Also as I wrote earlier a reportnumber that will be generated automaticaly.

    Regards
    Oeysbrei

  10. #10
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    It will be good if you have a sample output tab that we can help you automate. We can understand the layout with the help of the file.

  11. #11
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    arlu1201,

    I have put in some data in the sheet thats called kalkulasjon. Is this enough information or should I make some sort of usermanual for this sheet?

    I have attached the file again but now with a reportsheet that shows approximate how I want it to be
    Thank you for spending youre time helping me

    Regards
    Oeysbrei
    Attached Files Attached Files
    Last edited by Oeysbrei; 04-23-2012 at 03:51 PM.

  12. #12
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    Hi,

    Prompt

  13. #13
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    So, do you want the "Report" sheet to be designed from scratch using VBA? Will it just be 1 sheet or will there be multiple, like 1 for every object?

    I dont know ur language so its a lil tough to know whats in the file.

  14. #14
    Valued Forum Contributor
    Join Date
    03-16-2012
    Location
    Aarhus, Denmark
    MS-Off Ver
    Excel 2007
    Posts
    992

    Re: Generate report from excel

    Hej Oeysbrei,

    Just a few remarks:

    1) Your company logo you could put in the header of the Excel file.
    2) The following subroutine update the footer with reportnumber, given that this is input in A1, and date:

    Please Login or Register  to view this content.
    3) You could then call this sub from the WorkbookBeforePrint event like so:

    Please Login or Register  to view this content.
    Ad.3) You will need to put this code in the workbook object.

    I hope this answers some of your questions!?
    Last edited by Søren Larsen; 04-24-2012 at 04:15 AM.
    Sincerely
    S?ren Larsen

    "Give a man a fish, and you'll feed him for a day. Give a man a fishing rod, and he'll steal your yacht!"

  15. #15
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    arlu1201,

    I want the report to be one sheet, and saved as a single file with filename as reportnumber.
    I dont know if it has to be done by using VBA, but I guess it has. I have tried different myself, but have no idea how to solve this challenge.

    I´m pretty new at this, but learning slowly. So i´m glad I found this forum with people like you guys.

    Hope this answered youre question

    Regards
    Oeysbrei

  16. #16
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    Søren Larsen,

    Thank you Søren.
    I will keep on trying, so I will test these subs and hopefully solve bit by bit

    Regards
    Oeysbrei

  17. #17
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    I want the report to be one sheet, and saved as a single file with filename as reportnumber.
    Is it just one sheet or do you need the task to be repeated a certain number of times?

  18. #18
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    arlu1201,

    I need it to generate a new reportnumber everytime a new report get saved. So when new data gets inserted in the sheet Kalkulasjon (Calculation), I want to generate a new report.

    Regards
    Oeysbrei

  19. #19
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    Do you need the macro to clear the contents of the sheet Calculation after creating the report?

  20. #20
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    arlu1201,

    It doesent have to be cleared, because when new data gets inserted in the calculationform the reportform will change.
    But when saving the report, the macro can open up the calculationform again.

    I know this is a big task, and hoping i´m not asking to much
    I appreciate all the help and effort you put in to this.

    Regards
    Oeysbrei

  21. #21
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    arlu1201,

    Have you had any time looking in to this? I have tryed myself to solv it bit by bit, but havent come any further.

    Regards
    Oeysbrei

  22. #22
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    Just a suggestion after reviewing your output file.

    Since you have already created the format, how about continuing with it and then having the button just save the report for you in the desired location with the required name?
    The output file already shows the links to the various sheets from where you require the values to pour thru. Once you put in the required logos, the button just needs to save your file.

  23. #23
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    arlu1201,

    I had planed to use the form as it is so it would be easy to add data, but it needs to generate a new reportnumber to be located top right corner everytime it gets saved.
    This also needs to be the filename, so it will be easy to search for it.

    I have got a code to save it as a single PDF file, but I cant make the form to show in one page.

    Regards
    Oeysbrei

  24. #24
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    In what format should the reportnumber be?

  25. #25
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    arlu1201,

    I want the reportnumber to be three letters followed by three digit number like: TTS-001, next report will be TTS-002
    Would this be possible?

    I have got a code that I can use to save as single sheet, that also creates the filename.
    Please Login or Register  to view this content.
    I think there is a way were the filename can be used in the header, and gets updated automatic.
    Can you confirm this?

    I will try work on a solution for the need of training

    Regards
    Oeysbrei
    Last edited by Oeysbrei; 04-30-2012 at 02:29 PM.

  26. #26
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    Hi arlu1201,

    I have been trying to solv this task without luck, I only mess things up. luckaly I have made a copy of the workbook that have come usefull several times.
    Any ideas how I can open up the reportsheet as a single PDF file. The code I posted earlier doesent work as I want, or maybe it´s me that´s not doing it right.

    If I only could get the PDF to open, I could name it manually befoure saving it.
    The entire workbook needs to be finish in 10 days, so I have to keep it simple the days I have left.

    Thanks for all youre help

    Best regards
    Oeysbrei

  27. #27
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    I have no experience with PDFs. Will forward it to the experts.

  28. #28
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    arlu1201

    The reportform is finish, and I thought I had the code work as I wanted.
    The report get saved and opened as I want.

    The only problem I have now is that everytime I open the workbook after it has been closed, the filname gets saved counting from one again.
    I need something in the code that remember the last number that was saved.

    Is there a way to do this?

    This is the code i´m using
    Please Login or Register  to view this content.
    Regards
    Oeysbrei

  29. #29
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    Will the generated reports be saved in your file or will they be only independent files?

    If they are not saved in the main file, then we will need to keep a record of each report number that is generated or atleast the last report number.

    You can use a cell in a sheet that will always remain in the file and save the report number there. Then when the new report number is generated, it should add 1 to the report number in that cell.

  30. #30
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    arlu1201,

    That sounds like a god idea.
    This is a school project for a company that I hope will be satisfied enough to develop it further to suit their needs.
    Youre solution will make it able to be used eighter on a local computer or if used from a server.

    But is there a way I can implement that to the existing code?

    Oeysbrei

  31. #31
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    Hello,

    Bump

  32. #32
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    Hi,

    This code makes me able to save a sheet as a single PDF were the filename gets TTS-1 first time saved, and TTS-2 next time and so on.
    The problem I have is that when the workbook gets opened again after been closed, it starts counting from one again.

    Does anybody have any ideas what to do so that it remembers the last number saved?

    Please Login or Register  to view this content.
    Regards
    Oeysbrei

  33. #33
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    Quote Originally Posted by Oeysbrei View Post
    Hi,

    This code makes me able to save a sheet as a single PDF were the filename gets TTS-1 first time saved, and TTS-2 next time and so on.
    The problem I have is that when the workbook gets opened again after been closed, it starts counting from one again.

    Does anybody have any ideas what to do so that it remembers the last number saved?

    Please Login or Register  to view this content.
    Regards
    Oeysbrei
    Anyone plz?

  34. #34
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Generate report from excel

    You can try this. I have added the line to your above code
    Please Login or Register  to view this content.

  35. #35
    Forum Contributor
    Join Date
    04-02-2012
    Location
    Bergen, Norway
    MS-Off Ver
    MS 365 Subscription
    Posts
    323

    Re: Generate report from excel

    Thank you,

    I will finally mark this solved

    Regards
    Oeysbrei

+ 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