+ Reply to Thread
Results 1 to 30 of 30

VBA report with forms

  1. #1
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Smile VBA report with forms

    At work I deal with a large amounts of sales data and the only tools I use to filter data and create reports are pivot tables but sometimes pivot tables won't give me the details I want the way I want. any time my boss asks me for a monthly report I have to do everything manually from the pivot table and insert the data on another table where I put the filteres data. I want to be able to get a monthly sales report per store that will populate itself in a daily basis, I also want to be able to select a store, style, size and date from a form in Excel and see the report in a sheet. Aproblem that I have found in order to use the size as a parameter is that the size comes in the same line as the item description and do not know how to make excel to check just for the size in the description field.
    The attached file contains sales data for a better understanding of my case.
    I will really appreciate some help in this matter.

    Thanks

    Moroformat
    Last edited by moroformat; 12-15-2009 at 02:09 AM.

  2. #2
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: Sales Report

    Please change your thread Title. Please specify your problem ...

    and where is the PT?
    Last edited by rwgrietveld; 12-05-2009 at 06:24 PM.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  3. #3
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: VBA report with forms

    What is a PT?

    Moroformat

  4. #4
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Re: VBA report with forms

    PT Pivot Table and have you looked at http://www.contextures.com/xlPivot01.html

  5. #5
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: VBA report with forms

    Does anyone know how would I be able to create a program in VBA with the functionalities mentioned above?
    Help would be really appreciated

    Moroformat

  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: VBA report with forms

    Hi Moroformat
    Are you asking for two things here?
    I want to be able to get a monthly sales report per store that will populate itself in a daily basis
    When you say "auto-populate on a daily basis", where will the information come from?
    I also want to be able to select a store, style, size and date from a form in Excel and see the report in a sheet.
    What is the "Style"? Is it this
    White/White Cap Sleeve
    What does the report you attached represent? Is this the daily report?

    How about creating an example worksheet for each of the above so I can get a picture of what your output would look 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.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA report with forms

    You can group data in a Pivottable by Month, Quarters and Years. A VBA solution would not be as quick oe efficient asa PivotTable

    Here's a quick example using your data
    Attached Files Attached Files
    Last edited by royUK; 12-06-2009 at 02:57 PM.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  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: VBA report with forms

    Hi moroformat
    This code will split size and style into two different columns with your sample data.
    Please Login or Register  to view this content.
    I'll be glad to look at the other issues with your feedback; alternately, look at royUK's pivot table solution.
    Let me know of issues.
    John

  9. #9
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Smile Re: VBA report with forms

    Hello jaslake,

    Thank you so much for taking the time to look at my little puzzle. In response to your inquires :

    1.All the Data will be taken from the table in the file I attached which is nothing more than a daily sales report our client sends to us every day.

    2. Basically I want to generate a monthly summary report per show like the one I am just attaching with the name "Summary" and also a more detailed like the one I also attached named "Detailed_Monthly_Report". I Currently populate these two reports individually by creating a pivot table and then getting the numbers from the pivot table to the "summary" and "Detailed_Monthly_Report" reports which is very time consuming and inefficient. I would like for the "summary" and "Detailed_Monthly_Report" reports to populate daily as i add more data to the sales table so I can also be able to take better decisions at work.
    The most important thing I would like you to help me with is a VBA program in a different sheet with forms that will allow for my boss and me to filter or access data from both the "Summary" and the "Detailed_Monthly_Report" reports in a more concise and fast way after selecting certain parameters.

    3. White/White Cap Sleeve - In this case, the style would be "Cap Sleeve". The style is everything other than the colors.

    Thank you for everything and I would really appreciate it if you could help me.

    Moroformat
    Last edited by moroformat; 12-15-2009 at 02:09 AM.

  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: VBA report with forms

    Hi monoformat

    Either we're not communicating or I'm not understanding (probably the latter). You've attached a file (Sales-2009) for the months of Oct 08 thru Jan 09. You also attached a file (Summary_2009) that appears to include Jun 2009 thru Sept 2009. These files appear to have no relationship to each other. I can find few (if any) "stores" on both lists.
    With regard to the Detailed Monthly sheet, what is the "South Central Show"? Where does that come from? There's no reference to that in the other two sheets that I can see.
    You had mentioned this
    Please Login or Register  to view this content.
    I assume you want this on the summary sheet but your example doesn't reflect that.
    With regard to stores; what is the key: Store or Warehouse?
    With regard to the "Summary Sheet"; will it look like your posted sheet?
    Based on what you've posted, I'm not understanding. I'm a linear thinker. There are others on this site that are perfectly capable of thinking "out of the box". It appears you've given me what you have. Give me a co-ordinated example of what you want to see. I need more direction.
    John

  11. #11
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: VBA report with forms

    Ey John,
    I am sorry for just throwing information without giving you more details.
    The files I attached are just a small fraction of the data I regularly use since i cannot post a file greater than 1MB in this web site.
    The files I sent you are to help you understand my needs and give you a better idea. The summary file does not reflect the size feature I was telling you but the detailed file does.

    In regards to the stores: the store and warehouse are essentially the same but the "store" field gives you the name and the "warehouse" field gives you the number associated to that store. I would say that the key is the store since it helps the managers easily identify the store although the warehouse is probably very important for look up purposes to avoid mistakes.

    "South Central Show" is a store name. I know is not included anywhere else in my files but it was just to give you an idea of what specifically have to do for every single show each month(You could replace the name with another store name contained in the sales file for your convenience).

    The problem I have right now is that we have about 250 different stores per month which implies that I have to do 250 reports like the one in the "detailed file" for the "South Central Show" store but for other 249 stores that are running in an specific month. We always change stores each month so each month new data is added to the sales file with different store names and sales data from which we need to to know sales and items sold figures per store to be able to know what store sold the most and within the store what style sold the most and within the style what size sold the most to be able to make better analysis and be able to make better predictions for other months for the stores,styles and sizes in an specific month.

    To be clear and simple, I want to be able to generate a report(taking data from the "sales_2009_1" file) that gives me the following the parameters contained in the detailed file:

    Total sales and total items sold per store per day and total sales and total items sold per store per month that you can calculate from the "Extended cost" and "quantity" fields in the sales file.

    I also need to be able to see monthly total sales(sales can be calculated from the extended cost field in the sales file) and monthly total items sold(You can get this from the amount field) per style( Cap Sleeve, Perfect Tank, Perfect Tee, and Camisole ) per store (like "South Central Show") , which together will have to be equal to the total monthly sale of the store.

    I would also need to be able to find the monthly total revenue(sales can be calculated from the extended cost field in the sales file) and monthly total number of items sold(You can get this from the amount field) per style(Cap Sleeve, Perfect Tank, Perfect Tee, and Camisole ) per size(L,M,S,XL) per store("South Central Show").

    I other words I need to see a monthly total sales and monthly total items sold per store, and within each store a monthly total sales and monthly total items sold per style, and within each style a monthly total sales and monthly total items sold per size. As you can see this can take forever if done without a program or something of the sort considering the amount of sales data I get every day and the number of store we constantly change and have.

    Thank you for your time john




    Moroformat

  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: VBA report with forms

    Hi moroformat
    I'm going to noodle on this for a day or so to come up with some ideas. As soon as I have something for you to look at, I'll post it. I'll probably do this in steps because it could get quite complex. I would hate to move too far down the road and find out it doesn't suit your needs.
    I'll be in touch.
    John

  13. #13
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: VBA report with forms

    Thank you John.

    Moroformat

  14. #14
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA report with forms

    I can't understand why you don't use a PivotTable. I've posted an example that shows you how to get monthly & quarterly figures.

  15. #15
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: VBA report with forms

    royUK,

    I am currently using pivot tables to get the info for my report. The problem with pivot tables is that they are not as detailed and sometimes they cannot give the parameters I want besides the fact that the officers of the company I work for do not like using pivot tables. I am trying to create a VBA form report that my bosses can access easily and get all the info they need.

    any other suggestions?

    Thanks,

    Moroformat

  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: VBA report with forms

    Hi moroformat
    Still noodling. I should have a first pass for the "Summary" file in the next day or two. I have the "Summary" report pretty well figured out. I'm working on the User Input to chose what month they wish to see. As soon as I have something I'm comfortable with, I'll give it to you for your review and input.
    John

  17. #17
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: VBA report with forms

    Quote Originally Posted by moroformat View Post
    royUK,

    I am currently using pivot tables to get the info for my report. The problem with pivot tables is that they are not as detailed and sometimes they cannot give the parameters I want besides the fact that the officers of the company I work for do not like using pivot tables. I am trying to create a VBA form report that my bosses can access easily and get all the info they need.

    any other suggestions?

    Thanks,

    Moroformat
    PivotTables are one of the best data tools in Excel, if you want details of a particular result double clicking will generate list of data that makes up that resul in a separate sheet.

  18. #18
    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: VBA report with forms

    Hi moroformat
    The attached workbook contains code that will create a summary sheet for store sales based on the month the user selects. I'd like you to look at it and tell me if I'm heading in the right direction.
    John
    Last edited by jaslake; 12-27-2009 at 10:25 PM. Reason: Remove attachements at OP's request

  19. #19
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: VBA report with forms

    John,

    I created a report with forms that makes an automated report.

    Moroformat
    Last edited by moroformat; 12-28-2009 at 10:07 AM.

  20. #20
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: VBA report with forms

    John,

    I am sending you the one i created to see if there is something else I can do.

    Moroformat
    Last edited by moroformat; 12-27-2009 at 08:36 PM.

  21. #21
    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: VBA report with forms

    Hi moroformat
    I'm glad that the initial effort meets with your approval. The user interface is quite weak but I'll look at that. Since you feel I'm on the right track, I'll move ahead with the "Detail Report". At this point, I don't have any questions but I'm certain some will come up.

    The "Detailed Report" will involve a lot of code just for the formatting. I'm concerned about the file size. We'll see how it progresses. Hope you have a ton of memory available .

    I'll get back to you in a couple of days. John

  22. #22
    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: VBA report with forms

    Hi moroformat
    I'm stuck on an issue with the "Detail Report". The issue is how many styles are we potentially dealing with. In your sample report, you show 4 being:

    Cap Sleeve
    Perfect Tank
    Perfect Tee
    Camisole

    Are there more or is this it? If this is it, it makes life a whole lot easier; if not, please post a complete list. You may like the new "User Interface" I've designed.
    John

  23. #23
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: VBA report with forms

    John,

    The only two styles that we need to add are the following two:
    Perfect V
    Cardigan

    Thanks,

    Moroformat

  24. #24
    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: VBA report with forms

    Moroformat
    If I add Perfect V and Cardigan to the Styles List and a Show has no sales for these two styles (reflects 0.00) will that be an issue? Not certain if this solves my problem but is this an OK approach?
    John

  25. #25
    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: VBA report with forms

    Is "LS" also a style?

    In breaking down the styles I now have these:

    Styles
    Cap Sleeve
    Perfect Tee
    Perfect Tank
    Perfect V
    LS
    Camisole
    Cardigan

    Is this correct?
    John

  26. #26
    Registered User
    Join Date
    10-31-2009
    Location
    S
    MS-Off Ver
    Excel 2003
    Posts
    25

    Re: VBA report with forms

    John ,

    You are correct, I totally missed the LS style. And the data I sent you did not include any sales for that style but that should not be a problem since that will be included when using the real data.

    Thank you for your time,

    Moroformat

  27. #27
    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: VBA report with forms

    Hi moroformat

    Wanted to give you an update and let you know I've not yet given up.
    I've had the "Detail Report" surrounded several times the last couple of days but keep running into situations that need "work around's". With a complex project such as this, "work around's" are not such a good idea; they always come back to bite you in the butt. So, I'm trying best I can to "standardize" things.
    I think the "Month Summary" report is ready for your testing if you wish to do that. If so, let me know and I'll break the file apart and send just that part to you. This is what I posted before but I've changed the code and interface considerably. It really needs tested on other data files for consistency.
    John

  28. #28
    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: VBA report with forms

    Hi moroformat
    I've got this pretty well surrounded. I've beat this up pretty well and have most of the kinks worked out. I want to spent a little more time on it to clean up some issues I don't like but I also want you to look at it to see what changes you'd like made.
    Let me know what issues you have.
    John
    Last edited by jaslake; 12-27-2009 at 10:24 PM. Reason: Remove attachements at OP's request

  29. #29
    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: VBA report with forms

    Hi moroformat
    I took most of the day off from our project; thought I'd sit down before dinner and just play with the Daily Summary to see if I could break it. I noticed right away that I've duplicated some information on the report. I'll fix that but, I'd still like you to look at it to see if there are any changes you'd like to make.
    John

  30. #30
    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: VBA report with forms

    Hi moroformat
    The attached seems to work without a hitch on all the test data. I'll wait to hear from you.
    John
    Last edited by jaslake; 12-27-2009 at 10:24 PM. Reason: Remove attachments

+ 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