Below is code kindly provided by killazzz. Attached is the document that contains the code.
Within the document is a userform that contains a series of comboboxes, some of which are disabled. Each combobox represents an item that has a unique price.
When the code is executed, any comboboxes that are enabled, but false will be added to the document in the form:
checkbox.caption <TAB SPACE> £ <TAB SPACE> Price
VB Code:
Private Sub CommandButton1_Click()
'you define an array of all your prices and string variables
I am now attempting to alter the code slightly so that the items to be added to the document are done so using a table.
What I have attempted to do is create another array that has 3 columns and the number of rows is equal to the number of items to be added. I than want to create a table of equivalent dimensions and add that to the document.
For example, if there were 2 items to be added to the document (in reality the list is much larger), I would get a 2 row, 3 column table, which would contain the following items.
I also want to set column sizes and word alignment, but can probably work that out later. I have made numerous attempts at the above, but am having real difficulty. I have referenced arrays in the help files in vba, but can't seem to apply the information correctly (obviously it is the help files at fault )
Any help appreciated.
Last edited by New2vba; Mar 26th, 2006 at 12:30 PM.
"Those things we must learn to do, we must learn by doing" (or hope somebody else will take pity and help out )