+ Reply to Thread
Results 1 to 11 of 11

Need Help in Creating Automated Report using Macros

Hybrid View

celine.04 Need Help in Creating... 05-15-2018, 07:59 PM
BoredWorker Re: Need Help in Creating... 05-15-2018, 10:53 PM
celine.04 Re: Need Help in Creating... 05-22-2018, 09:36 PM
JeteMc Re: Need Help in Creating... 05-28-2018, 04:22 PM
celine.04 Re: Need Help in Creating... 05-28-2018, 06:50 PM
JeteMc Re: Need Help in Creating... 05-28-2018, 08:00 PM
celine.04 Re: Need Help in Creating... 05-28-2018, 08:20 PM
JeteMc Re: Need Help in Creating... 05-29-2018, 09:11 AM
celine.04 Re: Need Help in Creating... 05-29-2018, 06:44 PM
JeteMc Re: Need Help in Creating... 05-29-2018, 09:31 PM
celine.04 Re: Need Help in Creating... 05-30-2018, 09:07 PM
  1. #1
    Registered User
    Join Date
    05-14-2018
    Location
    Cebu, Philippines
    MS-Off Ver
    2013
    Posts
    7

    Need Help in Creating Automated Report using Macros

    I need help in getting a VBA Codes for my report. I run a report daily, I have around 2000 items, this is an invoice report on all our customers in one worksheet. Each customers has 3 or more invoices, seldom has one invoice only. We have around 300 customers.

    Columns as follows:
    A - CUSTOMER NAME
    B - INVOICE NUMBER
    C - INVOICE DATE
    D - INVOICE DUE DATE
    E - AGE OF THE INVOICE
    F - INVOICE AMOUNT
    G - FREQUENCY (NUMBER OF DAYS FROM THE FIRST ORDER TO THE NEXT ORDER DATE) - usually those customers with only 1 invoice is blank, meaning no frequency.

    This is what I need to do, and we had this project on getting an automated report:
    1. I need to get the last invoice date of each customer.
    2. Need the total number of invoice/s of each customer
    3. The total invoice amount of each customer, meaning from first to the last invoice they have with us.
    4. Total Frequency of each customer
    5. Average Order date, that is #4 divided by #3
    6. Estimated Next order date, that is the answer to #5 plus #1 - the date of the last invoice
    7. Next Order Date Due in 7 days, that is the answer to #6 plus 7 days
    8. Next Order Date Due in 2 weeks, that is the answer to #6 plus 2 weeks
    9. Next Order Date Due in 1 month, , that is the answer to #6 plus 30 days

    And there is another sheet which would provide a reminder on which customer to contact on those date every time the report is run.

    I have been working on VBA Code but it seems not successful, I have been learning Macros for almost a month now and I am really in need with help on this. I know this is a tough work.

    Any suggestions?

    Thanks!
    Celine

  2. #2
    Forum Contributor
    Join Date
    03-22-2017
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    230

    Re: Need Help in Creating Automated Report using Macros

    several question.

    1. How you want the date look like?
    Please upload a sample file for raw and desired result.
    > GO advanced > manage attachment > upload > close window

    2. did Q5 you request is weired? (frequency/amount to get date??)

    3.
    customer to contact on those date every time the report is run.
    Please clarify further, which date to be used.

  3. #3
    Registered User
    Join Date
    05-14-2018
    Location
    Cebu, Philippines
    MS-Off Ver
    2013
    Posts
    7

    Re: Need Help in Creating Automated Report using Macros

    Hi BoredWorker - Sorry if I was not able to respond immediately. I was out the entire week last week.

    By the way, see attached raw file. I would really appreciate your help on this.

    1st tab is the Raw data, I sort of created a macro that would remove all the special characters and would already calculate the frequency of each invoices.
    2nd tab (Final Output) is what I need to be automated,
    and so as the 3rd tab or reminder tab.
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,040

    Re: Need Help in Creating Automated Report using Macros

    Hello celine.04 and Welcome to Excel Forum.
    The columns on the Final Output sheet don't match the first post, however I have automated columns A:E using formulas.
    The formula for column A* is: =INDEX(Data!B$3:B$1359,MATCH(0,COUNTIF(A$1:A1,Data!B$3:B$1359),0))
    The formula for column B* is: =MAX(IF(Data!B$3:B$1359=A2,Data!F$3:F$1359))
    The formula for column C* is: =B2-MIN(IF(Data!B$3:B$1359=A2,Data!F$3:F$1359))
    The formula for column D is: =COUNTIFS(Data!B$3:B$1359,A2)
    The formula for column E is: =IF(D2=1,90,C2/D2)
    The formulas for columns F:I are unchanged.
    I feel that we would need some explanation of how the columns on the Reminder sheet need to be filled before we could attempt to write formulas/code to automate that sheet.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  5. #5
    Registered User
    Join Date
    05-14-2018
    Location
    Cebu, Philippines
    MS-Off Ver
    2013
    Posts
    7

    Re: Need Help in Creating Automated Report using Macros

    Hello Forum Expert, Thank you so much for your response. I was really looking into this forum because I was ask to get this data done.

    This is very useful.

    Sure, we can work on how the reminder sheet would be automated. And so as the entire workbook.
    Let me know the process and how this work.

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,040

    Re: Need Help in Creating Automated Report using Macros

    Before we would be able to work on automation of the Reminder sheet, we need you to tell us how the companies are assigned to the 'Next Order' columns. For example why is Company 3 in the next order date is today column? According to the Final Output sheet the estimated next order date for company 3 was October 11, 2015. Similarly company 5 is listed under next order date in 7 days, although the Final Output sheet shows the est. next order date being May 19, 2014.
    Let us know if you have any questions.

  7. #7
    Registered User
    Join Date
    05-14-2018
    Location
    Cebu, Philippines
    MS-Off Ver
    2013
    Posts
    7

    Re: Need Help in Creating Automated Report using Macros

    Sure,

    I set the reminder tab as an example, the sheet I attached was only an example on how it the REMINDER TAB looks like. I was not able to get the correct output on the companies with the correct data because I only showed a sample. I really apologize for that. The Reminder Tab should be based on the final output sheet.

    I have another question, or request with the following formula:
    The formula for column A* is: =INDEX(Data!B$3:B$1359,MATCH(0,COUNTIF(A$1:A1,Data!B$3:B$1359),0))
    The formula for column B* is: =MAX(IF(Data!B$3:B$1359=A2,Data!F$3:F$1359))
    The formula for column C* is: =B2-MIN(IF(Data!B$3:B$1359=A2,Data!F$3:F$1359))
    The formula for column D is: =COUNTIFS(Data!B$3:B$1359,A2)
    How to I make Data!B$3:B$1359 an indefinite array. Like the entire Column, not just limit to cell 1359. There is an instance the Data Sheet will add up more invoices on a daily basis.

    Thanks!

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,040

    Re: Need Help in Creating Automated Report using Macros

    I would suggest turning the range of data on the Data sheet into a table as modeled in the attached updated file. The references to ranges on the Data sheet could then be converted to structured references, such as Table1[Customer] which expand as the columns on the Data sheet are appended.
    As to the Remind sheet the columns are populated with formulas similar to:
    Formula: copy to clipboard
    =IFERROR(INDEX('Final Output'!$A$2:$A$500,AGGREGATE(15,6,(ROW($2:$500)-1)/(('Final Output'!$F$2:$F$500>TODAY())*('Final Output'!$F$2:$F$500<=TODAY()+7)),ROW(1:1))),"")

    Let us know if you have any questions.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    05-14-2018
    Location
    Cebu, Philippines
    MS-Off Ver
    2013
    Posts
    7

    Re: Need Help in Creating Automated Report using Macros

    Got it.

    Wow you are a super! This is all I needed. Thank you so much. Can't thank you enough! :-)

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,040

    Re: Need Help in Creating Automated Report using Macros

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools drop down in the ribbon above your first post. I hope that you have a blessed day.

  11. #11
    Registered User
    Join Date
    05-14-2018
    Location
    Cebu, Philippines
    MS-Off Ver
    2013
    Posts
    7

    Re: Need Help in Creating Automated Report using Macros

    Sure thing I will. Thank you for being helpful. :-)

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Automated Report Generation
    By tiny369 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-28-2015, 03:12 PM
  2. Replies: 0
    Last Post: 07-27-2015, 01:06 PM
  3. automated monthly report
    By victorbparjr in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-09-2014, 02:59 AM
  4. Automated email to send worksheet as report
    By wellseytd in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-10-2011, 10:28 AM
  5. Blackberry Friendly report automated
    By Excel_Enthuse in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-15-2008, 06:43 AM
  6. Using Excel for both SQL mining and automated report formatting
    By Sean Anderson in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-29-2007, 01:03 PM

Tags for this Thread

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