Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table Headings in word

Status
Not open for further replies.

eagleclaw

Programmer
Sep 20, 2002
19
US
I am trying to do a macro that will bring up a dialog box with a list of forms. when the user selects a document type (ie Letter, Fax or Memo) a unique identifier is created consisting of a prefix and a sequence number so the data wouold look like
Column 1 Column2 Column3
Letter ltr 0000001
Fax fax 0000001
I would look up The type from column 1 take the prefix from column2, concantenate the sequence number from column 3 to g3et my file name. I would then increment column3 by 1 and close the document with the table in it. My question is how would I locate the right row and column in word, or is there a better way to do this like using access?


 
Hi,
Does it have to be a Word table? I'd do it in Excel

1. Create your table - using named ranges like...
Code:
FormName  Prefix   SeqNbr
2. Create your userform with a Combobox

3. Link the RowSource to named range, FormName

4. Use the Combobox.Index property along with Worksheet Function INDEX to get the Prefix and SeqNbr.
Code:
With Combobox
   idx = .Index
   sPrefix = Application.Index(Range("Prefix"),idx,1)
   SeqNbr= Application.Index(Range("SeqNbr"),idx,1)
End with
Hope this helps :)


Skip,
Skip@TheOfficeExperts.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top