Bookmarks Dependant on Input?? Possible??

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Thanks in advance you guys!

It's late here in NZ and my brain is shutting down!

I was wondering if someone could help me out with the following?

I want to ask the user how many addresses they want to deal with in a
document. The answer would just be a number: 1 to whatever.

I then would need a form that asks what each individual address is.

Once that is done, I would like a form that puts the addresses into a line,
with a ", " [comma and space] after each one.

Goodness - if you solve that while I was asleep, I'd be ever so grateful!!

Cheers


edi
 
Dim i As Long, j As Long
Dim addresses As String
i = InputBox("Enter the number of addresses")
addresses = ""
For j = 1 To i - 1
addresses = addresses & InputBox("Enter Address No. " & j) & ", "
Next j
addresses = addresses & InputBox("Enter Address No. " & i)
Selection.InsertAfter addresses


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
That's marvellous, thank you Doug!!

How about extending this a wee bit further!?

By default, there is one cell in the document (set up with a table) that
refers to one address and a description of that address, and a second cell
referring to some specific details about that address i.e. those cells would
be headed respectatively ADDRESS DESCRIPTION & ADDRESS SPECIFICS

The table is a single column with a row for each section.

Is there any way to copy those 2 cells depending on the number of addresses
inputted at the start [using your dialog given in response to my 1st query]
and copy them the appropriate number of times, inserting the respective
address it refers to in the heading in the cell? (or if not copy, then some
other way of inserting the correct number of cells!?)

eg below - there are 3 addresses entered in the dialog you provided:

13 brown street - red house, white roof
specifics - 4 people, 2 dogs, 1 cat

19 black street - blue house, white roof
specifics - 1 people, 0 dogs, 1 cat

15 blue street - brown house, white roof
specifics - 2 people, 0 dogs, 0 cat


Each one would use a cell with its description, and then one below with its
specifics!?

Confused!? I hope not!!

Thanks again for your time .... I reckon I may be able to sort out this
query myself, but it would take me and awful long time - I appreciate your
help!




edi

Doug Robbins - Word MVP said:
Dim i As Long, j As Long
Dim addresses As String
i = InputBox("Enter the number of addresses")
addresses = ""
For j = 1 To i - 1
addresses = addresses & InputBox("Enter Address No. " & j) & ", "
Next j
addresses = addresses & InputBox("Enter Address No. " & i)
Selection.InsertAfter addresses


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

Kiwi Ed said:
Thanks in advance you guys!

It's late here in NZ and my brain is shutting down!

I was wondering if someone could help me out with the following?

I want to ask the user how many addresses they want to deal with in a
document. The answer would just be a number: 1 to whatever.

I then would need a form that asks what each individual address is.

Once that is done, I would like a form that puts the addresses into a
line,
with a ", " [comma and space] after each one.

Goodness - if you solve that while I was asleep, I'd be ever so grateful!!

Cheers


edi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top