I need to read invoices from multiple sheets. Each sheet has a contract number.
I want to write all the invoices to a single sheet, in a table. But I need to write the “foreign key”, that is, to what contract each invoice belongs to.
Thus, I have acquired the contract value and stored it in VarContractNum.
I have found and used ReadRange for the invoices from that contract sheet (let’s say B35:J50), stored in VarDatabase
Now I use a write range, “TableInvoices”, starting at B2, source VarDatabase.
Everything fine up to this point.
But now, I want to write, from A2 to A17 the same contract number, showing that all transfered invoices from B35:J50 of sheet contract 5050 belong to contract 5050.
It seems WriteRange and AutoFill Range all depend on using a DataBase variable, and contract number was stored at VarContractNum.
Anyway to paste a single value from a single variable to a range, or will I have to slowly write each line using a counter?