help with VBA syntax
how do I ....
Add numeric values beneath field names, where the numeric values originate from an underlying table created on a worksheet called "table". The table is organised as follows
Column A column B
GWP 1
UPR
Earned Premium 2
RI CY 6
RI PY 7
Claims CY 4
Claims PY 5
Expenses 3
Investments
Tax
Result 8
My source file is imported to sheet 1 and the fields are organised in the order shown by Column A. However I would like to run multiple reports from the same extract so the purpose of column B is to identify the fields required and use a number identifier so they can be sorted in the required order.
What syntax would I use to match the fields in my table (containing an entry in column B) with those in the extract file and then insert the value in the row beneath the field caption. Lets assume the fields on sheet 1 (the extract) are in row 1 and row 2 is a blank row anyway.
I can't suss out whether I need an array statement, a combination of array and redim preserve or if its a Do Loop type thing. I guess the variable should hold all values from the table before comparing them to the fields across the extract on sheet 1 rather than step through on a field by field basis.
I'd appreciate any help with this even if it's just a simple example or some pointers on the syntax required.
Many thanks.
Jacqui
|