Hi,
I have nearly finished a document I have created but have a few finishing touches I need help on, below I have an input sheet where I have invoices to input, I am trying to get each row to separately go into the relevant table, it works with the code below but I'm wanting the code to be relevant to lines 9-15, in the below example only 9 & 10 are copied over to the relevant tables as 11-15 are blank but the code I have will only copy line 9:
Dim ary As Variant, n As Variant
'Names of accounts from 1 to 19
ary = Array("Revenue", "Direct Costs", "Overhead", "Fixed Asset", "Current Asset", "Current Liability", _
"Non-Current Liability", "Equity", "VAT", "Tracking", "Accounts Payable", "Unpaid Expense Claims", _
"Bank Revaluations", "Unrealised Currency Gains", "Realised Currency Gains", "Accounts Receivable", _
"Inventory", "Historical", "Rounding", "Retained Earnings")
If Not IsError Then
n = Application.Match(Sheets("Input Sheet").Range("L9").Value, ary, 0)
With Sheets("Chart of Accounts").ListObjects("Table" & n).ListRows.Add.Range 'add a new row and get its Range
.Cells(1).Resize(1, 5).Value = Application.Index(Sheets("Input Sheet").Range("M9:T9").Value, 1, Array(1, 2, 3, 4, 5, 6, 7, 8))
End With
I have nearly finished a document I have created but have a few finishing touches I need help on, below I have an input sheet where I have invoices to input, I am trying to get each row to separately go into the relevant table, it works with the code below but I'm wanting the code to be relevant to lines 9-15, in the below example only 9 & 10 are copied over to the relevant tables as 11-15 are blank but the code I have will only copy line 9:
Dim ary As Variant, n As Variant
'Names of accounts from 1 to 19
ary = Array("Revenue", "Direct Costs", "Overhead", "Fixed Asset", "Current Asset", "Current Liability", _
"Non-Current Liability", "Equity", "VAT", "Tracking", "Accounts Payable", "Unpaid Expense Claims", _
"Bank Revaluations", "Unrealised Currency Gains", "Realised Currency Gains", "Accounts Receivable", _
"Inventory", "Historical", "Rounding", "Retained Earnings")
If Not IsError Then
n = Application.Match(Sheets("Input Sheet").Range("L9").Value, ary, 0)
With Sheets("Chart of Accounts").ListObjects("Table" & n).ListRows.Add.Range 'add a new row and get its Range
.Cells(1).Resize(1, 5).Value = Application.Index(Sheets("Input Sheet").Range("M9:T9").Value, 1, Array(1, 2, 3, 4, 5, 6, 7, 8))
End With