Home

Using Microsoft forms to create an invoice in excel.

%3CLINGO-SUB%20id%3D%22lingo-sub-758451%22%20slang%3D%22en-US%22%3EUsing%20Microsoft%20forms%20to%20create%20an%20invoice%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-758451%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20made%20a%20form%20in%20Microsoft%20Forms%20in%20which%20orders%20can%20be%20placed%20for%20within%20the%20company.%20The%20goal%20is%20to%20have%20the%20data%20from%20a%20new%20form%20automatically%20added%20to%20a%20Pivot%20Table%20in%20which%20the%20data%20of%20the%20prices%20are%20also%20put.%20I%20have%20a%20few%20problems%3A%3C%2FP%3E%3CP%3E1.%20When%20calculating%20the%20total%20price%2C%20you%20can%20only%20seem%20to%20use%20two%20specific%20columns%2C%20but%20I'd%20like%20to%20have%20one%20column%20differentiate%20as%20I%20add%20or%20delete%20it%20from%20the%20pivot%20table.%3C%2FP%3E%3CP%3E2.%20How%20am%20I%20supposed%20to%20make%20a%20macro%20in%20which%20data%20from%20Microsoft%20Forms%20is%20added%20as%20a%20form%20and%20is%20filled%20in%20in%20the%20pivot%20table%3F%3C%2FP%3E%3CP%3E3.%20One%20question%20is%20from%20which%20store%20the%20order%20came%20in%2C%20can%20I%20add%20this%20automatically%20to%20the%20invoice%20when%20the%20form%20is%20filled%20in%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance%20for%20a%20response%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESuzanne%20Kepel%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-758451%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EOffice%20365%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-758501%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Microsoft%20forms%20to%20create%20an%20invoice%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-758501%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F377489%22%20target%3D%22_blank%22%3E%40Suzanne_01%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHi%20Suzanne%3C%2FP%3E%0A%3CP%3EWould%20you%20be%20able%20to%20upload%20a%20copy%20of%20your%20file%2C%20then%20maybe%20we%20can%20see%20how%20best%20to%20advise%20you.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-758508%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Microsoft%20forms%20to%20create%20an%20invoice%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-758508%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F106033%22%20target%3D%22_blank%22%3E%40Roger%20Govier%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOf%20course.%20It%20is%20in%20Dutch%20though%2C%20but%20I%20don't%20think%20that%20really%20matters.%20I%20added%20the%20function%20of%20each%20sheet%20so%20you%20know%20what%20it%20is%20for.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-758593%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Microsoft%20forms%20to%20create%20an%20invoice%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-758593%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F377489%22%20target%3D%22_blank%22%3E%40Suzanne_01%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHi%20Suzanne%3C%2FP%3E%0A%3CP%3EUsing%20a%20Pivot%20Table%20to%20generate%20an%20Invoice%20in%20this%20case%2C%20is%20not%20the%20best%20solution%20in%20my%20opinion.%3C%2FP%3E%0A%3CP%3EIn%20the%20attached%20file%2C%20which%20has%20been%20saved%20as%20a%20.xlsb%20as%20it%20contains%20two%20small%20macros%2C%20I%20have%20inserted%202%20new%20sheets%20called%20Extract%20and%20Invoice.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EExtract%20uses%20Advanced%20Filter%20to%20extract%20any%20given%20Order%20Number%20from%20your%20Tale%201%20on%20Sheet%201.%3C%2FP%3E%0A%3CP%3EInvoice%20uses%20the%20Transpose()%20function%20to%20turn%20the%20Extracted%20data%20from%20Horizontal%20to%20Vertical%2C%20and%20then%20uses%20Index()%20%2C%20Match()%20to%20pull%20through%20the%20price%20from%20your%20table%202%20on%20Blad2%20and%20then%20multiplies%20these%20by%20quantity%20to%20produce%20the%20line%20Totals%20which%20get%20Sumed%20at%20the%20end%20and%20have%20tax%20added.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESheet%20Invoice%20has%20some%20event%20code%20which%20gets%20triggered%20only%20when%20you%20change%20the%20Order%20number%20in%20cell%20C2%3C%2FP%3E%0A%3CP%3EPrivate%20Sub%20Worksheet_Change(ByVal%20Target%20As%20Range)%3CBR%20%2F%3EIf%20Target.Address%20%3D%20%22%24C%242%22%20Then%3CBR%20%2F%3EWith%20Application%3CBR%20%2F%3E.EnableEvents%20%3D%20False%3CBR%20%2F%3E.ScreenUpdating%20%3D%20False%3CBR%20%2F%3EEnd%20With%3CBR%20%2F%3ECall%20FilterData%3C%2FP%3E%0A%3CP%3EEnd%20If%3CBR%20%2F%3EWith%20Application%3CBR%20%2F%3E.EnableEvents%20%3D%20True%3CBR%20%2F%3E.ScreenUpdating%20%3D%20True%3CBR%20%2F%3EEnd%20With%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20there%20is%20a%20change%20then%20the%20FilterData%20code%20in%20module%201%20gets%20invoked%20to%20change%20the%20data%20that%20Advanced%20Filter%20Extracts%20to%20sheet%20Extract%2C%20and%20then%20used%20on%20sheet%20Invoice.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ESub%20FilterData()%3CBR%20%2F%3ESheet1.Range(%22Table1%5B%23All%5D%22).AdvancedFilter%20Action%3A%3DxlFilterCopy%2C%20_%3CBR%20%2F%3ECriteriaRange%3A%3DSheet5.Range(%22A1%3AA2%22)%2C%20CopyToRange%3A%3DSheet5.Range(%22A5%3AS5%22)%2C%20Unique%3A%3DFalse%3CBR%20%2F%3EEnd%20Sub%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20hope%20this%20helps.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-758619%22%20slang%3D%22en-US%22%3ERe%3A%20Using%20Microsoft%20forms%20to%20create%20an%20invoice%20in%20excel.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-758619%22%20slang%3D%22en-US%22%3EThank%20you!%20It%20does%20really%20help%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E
Suzanne_01
Occasional Contributor

Hi,

 

I made a form in Microsoft Forms in which orders can be placed for within the company. The goal is to have the data from a new form automatically added to a Pivot Table in which the data of the prices are also put. I have a few problems:

1. When calculating the total price, you can only seem to use two specific columns, but I'd like to have one column differentiate as I add or delete it from the pivot table.

2. How am I supposed to make a macro in which data from Microsoft Forms is added as a form and is filled in in the pivot table?

3. One question is from which store the order came in, can I add this automatically to the invoice when the form is filled in?

 

Thanks in advance for a response,

 

Suzanne Kepel

4 Replies

@Suzanne_01 

Hi Suzanne

Would you be able to upload a copy of your file, then maybe we can see how best to advise you.

@Roger Govier 

 

Of course. It is in Dutch though, but I don't think that really matters. I added the function of each sheet so you know what it is for.

@Suzanne_01 

 

Hi Suzanne

Using a Pivot Table to generate an Invoice in this case, is not the best solution in my opinion.

In the attached file, which has been saved as a .xlsb as it contains two small macros, I have inserted 2 new sheets called Extract and Invoice.

 

Extract uses Advanced Filter to extract any given Order Number from your Tale 1 on Sheet 1.

Invoice uses the Transpose() function to turn the Extracted data from Horizontal to Vertical, and then uses Index() , Match() to pull through the price from your table 2 on Blad2 and then multiplies these by quantity to produce the line Totals which get Sumed at the end and have tax added.

 

Sheet Invoice has some event code which gets triggered only when you change the Order number in cell C2

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$2" Then
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Call FilterData

End If
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub

 

If there is a change then the FilterData code in module 1 gets invoked to change the data that Advanced Filter Extracts to sheet Extract, and then used on sheet Invoice.

 

Sub FilterData()
Sheet1.Range("Table1[#All]").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Sheet5.Range("A1:A2"), CopyToRange:=Sheet5.Range("A5:S5"), Unique:=False
End Sub

 

I hope this helps.

Thank you! It does really help
Related Conversations
Tabs and Dark Mode
cjc2112 in Discussions on
46 Replies
Extentions Synchronization
Deleted in Discussions on
3 Replies
Stable version of Edge insider browser
HotCakeX in Discussions on
35 Replies
flashing a white screen while open new tab
Deleted in Discussions on
14 Replies
How to Prevent Teams from Auto-Launch
chenrylee in Microsoft Teams on
29 Replies
Security Community Webinars
Valon_Kolica in Security, Privacy & Compliance on
13 Replies