Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 12th, 2004, 02:08 PM
Registered User
 
Join Date: Jan 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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





Similar Threads
Thread Thread Starter Forum Replies Last Post
SQL Syntax in VBA? Bill_L Excel VBA 0 September 11th, 2008 08:47 AM
Vba Consolidate Syntax grouth Excel VBA 3 September 29th, 2006 07:37 PM
Fields object syntax in VBA query stepdev Access VBA 11 March 3rd, 2006 04:53 PM
How can use sql syntax in excel vba Biggladius Excel VBA 4 October 6th, 2004 04:15 AM
Word VBA Syntax Needed SerranoG VB How-To 4 October 28th, 2003 02:16 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.