Extract Rows of Data Using VLOOKUP With Multiple Criteria and Import to an Invoice for Each Customer

scoobydoo

New Member
Joined
Jan 6, 2010
Messages
25
Office Version
  1. 2007
Platform
  1. Windows
Hello, I'm seeking assistance in trying extract rows of data using vlookup with multiple criteria for a particular date range and import information into an invoice for each customers. I have a list of all salon customers and services rendered starting 2/1/2023 which I will update each month. I'm trying to create an invoice for each customers based on looking up Customer Name, Date Range for each month, i.e. 2/1/2023 thru 2/28/2023, and Payment Method = INVOICED. I would like to extract the Date of Service, Service Description, Service Costs, Tips and add Total. Please see below an example of the data set as well as the invoice.

I've worked out the part where I pull the customer's information into the invoice. However, I'm having difficulties figuring out how to get the list of services provided for a particular customer by date during the month.

Any assistance someone can provide will be greatly appreciated.

Data Set Example:

Customer NumberCustomer NameDate of ServiceMonthYearService DescriptionService CostTipsTotal CostsService ProviderPayment MethodNotes
5Bobby2/2/2023February2023GENTLEMAN'S HAIRCUT$19.00$19.00Hair Stylist - SavanahVENMO
1Adam2/2/2023February2023SHAMPOO & SET$28.00$2.00$30.00Hair Stylist - SavanahINVOICED
2Archer2/15/2023February2023NECK OR BANG TRIM$10.00$10.00Hair Stylist - SavanahINVOICEDBang Only
4Helen2/15/2023February2023HAIR COLOR/SHAMPOO & SET$75.00$75.00Hair Stylist - SavanahZELLE
10Douglas2/12/2023February2023HAIR COLOR/SHAMPOO & SET$75.00$75.00Hair Stylist - SavanahVENMO
8Burch2/12/2023February2023HAIR COLOR/SHAMPOO & SET$75.00$75.00Hair Stylist - SavanahLOCKBOX
3Betty2/23/2023February2023SHAMPOO & SET$28.00$12.00$40.00Hair Stylist - SavanahINVOICED
9Corchran2/23/2023February20231/2 HAIR CUT$14.00$14.00Hair Stylist - SavanahVENMO
5Bobby2/5/2023February2023MANICURE$20.00$20.00Nail Technician - FayeINVOICED
1Adam2/28/2023February2023MANICURE$20.00$20.00Nail Technician - FayeINVOICED
5Bobby3/2/2023March2023SHAMPOO & SET$28.00$28.00Hair Stylist - SavanahINVOICED
1Adam3/2/2023March2023SHAMPOO & SET$28.00$28.00Hair Stylist - SavanahINVOICED

Examples of Invoices based on Data Set

Example #1
Invoice112
NameAdam
Customer Number1
Service Start Date2/1/2023
Service End Date2/28/2023
Invoice Date3/13/2023
Invoice To:
Adam
123 Happy Lane
Denver, CO 11122
999-999-9999
Date of ServiceService DescriptionService CostsTipsTotalNotes
2/2/2023SHAMPOO & SET$28.00$2.00$30.00
2/28/2023MANICURE$20.00$20.00
Total Due$48.00$2.00$50.00


Example #2
Invoice113
NameArcher
Customer Number2
Service Start Date2/1/2023
Service End Date2/28/2023
Invoice Date3/13/2023
Invoice To:
Archer
456 Joy Road
Denver, CO 11122
999-999-1010
Date of ServiceService DescriptionService CostsTipsTotalNotes
2/15/2023NECK OR BANG TRIM$10.00$10.00Bang Only
Total Due$10.00$10.00


Example #3
Invoice114
NameBetty
Customer Number3
Service Start Date2/1/2023
Service End Date2/28/2023
Invoice Date3/13/2023
Invoice To:
Betty
789 Meadow View
Denver, CO 11122
999-999-1111
Date of ServiceService DescriptionService CostsTipsTotalNotes
2/23/2023NECK OR BANG TRIM$28.00$12.00$40.00
Total Due$28.00$12.00$40.00


Example #4
Invoice115
NameBobby
Customer Number5
Service Start Date2/1/2023
Service End Date2/28/2023
Invoice Date3/13/2023
Invoice To:
Bobby
1011 Everest Blvd
Denver, CO 11122
999-999-1213
Date of ServiceService DescriptionService CostsTipsTotalNotes
2/5/2023MANICURE$20.00$20.00
Total Due$20.00$20.00
 
I entered data for Sharon on the Data Set (Service Log) worksheet for February 14, 2023 and VENMO as the Payment Method.
I followed the same steps as you described and selected Sharon in C3 and the "No Responsible Party Info Found" popped up as it should. Are you using the macro in the same file you posted? If not, please upload a copy of the file that is generating the error.
 
Upvote 0

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
I followed the same steps as you described and selected Sharon in C3 and the "No Responsible Party Info Found" popped up as it should. Are you using the macro in the same file you posted? If not, please upload a copy of the file that is generating the error.
I just uploaded the file I'm using in Dropbox: scoobydoo mumps_Scoobydoo Revised-v1.xls. I just tried to create an invoice this morning and nothing happened. I think part of the problem is my inexperience with macros. I've had to close the file and re-open it in order for the process to work. Please advise me if this is proper. I plan on doing some Excel Macros & VBA tutorials after I finish this project. It's very intriguing how so much can be accomplished using macros. Thanks!
 
Upvote 0
I selected "Sharon" in C3 and got the "No Responsible Party Info Found" message so it's working properly for me. This line of code:
VBA Code:
Application.EnableEvents = False
at the top of the macro disables events (macros) from running in an infinite loop. This line of code at the bottom of the macro:
VBA Code:
Application.EnableEvents = True
enables events again so that the macros will run again. If the macro generates an error and you exit the macro before this last line of code is able to run, macros will not work. You have to close Excel then re-open it and re-open the file. You can avoid closing Excel and re-enable the macros by doing the following:
-open the VBA Editor
-hold down the CTRL key and press the letter G
-a window will pop up at the bottom
-type: Application.EnableEvents = True and press the ENTER key. This will re-enable the events.
I don't understand why you are getting the error since the file you posted is working properly for me.
 
Upvote 0
I selected "Sharon" in C3 and got the "No Responsible Party Info Found" message so it's working properly for me. This line of code:
VBA Code:
Application.EnableEvents = False
at the top of the macro disables events (macros) from running in an infinite loop. This line of code at the bottom of the macro:
VBA Code:
Application.EnableEvents = True
enables events again so that the macros will run again. If the macro generates an error and you exit the macro before this last line of code is able to run, macros will not work. You have to close Excel then re-open it and re-open the file. You can avoid closing Excel and re-enable the macros by doing the following:
-open the VBA Editor
-hold down the CTRL key and press the letter G
-a window will pop up at the bottom
-type: Application.EnableEvents = True and press the ENTER key. This will re-enable the events.
I don't understand why you are getting the error since the file you posted is working properly for me.
 
Upvote 0
I don't see a response from you. Is everything working properly now for you as it did for me?
 
Upvote 0
Mumps, I really appreciate your patience in helping me figure this out! I'm sure all the issues I was having were operator errors. :) I finally got it to work properly. I selected Felecia in C3 and got the message, "No data exists for Felecia for February 2023." Also, thanks for the instructions on how to enable events again without closing and re-opening Excel. That worked perfectly as well. I think I'm good to go now. I can't thank you enough!
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,286
Members
449,076
Latest member
kenyanscott

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top