A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data
Andreas
I am still going over your code. Sorry it is taking me a while. Jeovany and I met over video chat and he gave me so options that can be done with power query that I am looking into as well. I do have a couple of questions based on what I am seeing in your code. I tried to split the questions up based on the sections of the code.
Where are the items?
It is ok if there are no items in the invoice because I can have invoices with payments only.
'Be sure we have a numerical quantity for each used item
'Get the other file
Can’t I set this to auto open the file?
'Find the headings
Do I need this since I changed the stock file to a single file? Can I just search for the item in the stock file? I will probably need to write a check to make sure the item is in the stock file but do I need to worry about the headings?
'Be sure we can find all the items and there is a valid stock value
If my invoice is using data validation for the item field and pulling it out of stock file do I need to check to make sure the item is there? Does “Set Stock = Intersect(Stock.EntireColumn, Dest.EntireRow)” set the row based on finding the matching sku and if so why can’t I do this with the find and offset that I was using previously. In the statement (If MsgBox("Qty " & Qty & " > Stock " & Stock & "! Continue?", vbOKCancel + vbDefaultButton2 + vbQuestion, Title & ": " & Item) = vbCancel Then Exit Sub) does this open a message box with the option to continue?
FindHeader:
Completely confused as to what this is doing.
Errorhandler:
Will the code enter this anytime there is an error that is not accounted for in the above code?
Private Function GetWorkBook(ByVal WorkBookName As String) As Workbook
Not quite sure what this is doing. Is it checking to see that a workbook that we are going to be using is open?