Hi,
I managed to get some help with a code a few weeks back from someone who was very helpful indeed and the VBA he gave me worked a treat, my work book has since progressed and I'm needing the below code to do exactly what its been doing but pasting the highlighted cells in the order shown, I thought by changing what was originally in the code ("A6:D6") to what's in now would work but it hasn't:
Dim ary As Variant, n As Variant
'Names of accounts from 1 to 19
ary = Array("Fixed Assets", "Long Term & Current Assets", "Liabilities", "Income", "Trading Expenses", "Selling & Distribution Expenses", _
"Financial Expenses", "Premises Expenses", "Administration Expenses", "General Expenses")
n = Application.Match(Sheets("Input Sheet").Range("E6").Value, ary, 0)
If Not IsError
Then
With Sheets("Chart of Accounts").ListObjects("Table" & n).ListRows.Add.Range 'add a new row and get its Range
.Cells(1).Resize(1, 4).Value = Sheets("Input Sheet").Range("A6,B6,F6,D6,J6").Value
End With
I managed to get some help with a code a few weeks back from someone who was very helpful indeed and the VBA he gave me worked a treat, my work book has since progressed and I'm needing the below code to do exactly what its been doing but pasting the highlighted cells in the order shown, I thought by changing what was originally in the code ("A6:D6") to what's in now would work but it hasn't:
Dim ary As Variant, n As Variant
'Names of accounts from 1 to 19
ary = Array("Fixed Assets", "Long Term & Current Assets", "Liabilities", "Income", "Trading Expenses", "Selling & Distribution Expenses", _
"Financial Expenses", "Premises Expenses", "Administration Expenses", "General Expenses")
n = Application.Match(Sheets("Input Sheet").Range("E6").Value, ary, 0)
If Not IsError

With Sheets("Chart of Accounts").ListObjects("Table" & n).ListRows.Add.Range 'add a new row and get its Range
.Cells(1).Resize(1, 4).Value = Sheets("Input Sheet").Range("A6,B6,F6,D6,J6").Value
End With