referring to increasing VBA variable name in loop



I am using VBA to put together some phrases to be spoken with the text
to speech feature in excel.

What I've got is a list of string variables,

Phrase1
Phrase2
Phrase3
....
Phrase30

which are set equal to different words or phrases such as
Phrase1 = "Hello"

I can hard-code a variable name into the speech code such as:

XL.Speech.Speak Phrase1

this will successfully speak the string assigned to Phrase1.

What Im having trouble with is referring to the Phrase1-30 variables
in a for loop, something like

for i = 1 to 30
xl.speech.speak phrase & i
next

This code doesn't produce any speech, I'm assuming because the
variable name isn't being passed as intended. How can I refer to
variables within a loop, when the loop # (i) is part of the variable
name?

Thanks.
.



Relevant Pages

  • Re: Supremes "Buy It Now" in eBays favor
    ... Other President's - in the modern era - have relied on teams of speech ... writers to come up with their great words and phrases. ...
    (alt.marketing.online.ebay)
  • Re: Going to GP
    ... `Spoke using various complicated words and phrases' as if my speech were ... a morbid symptom of something. ... Well, no, you ill-educated thicko, I was ...
    (uk.people.support.depression)
  • Something to the effect of
    ... I've always thought of the phrases to be used when loosely reporting ... the content of someone else's speech to be as discussed in the Merriam- ... With that basic or general meaning, as in He said he was very worried, ... In the edited English of Google Books, "that" is more common, but not ...
    (alt.usage.english)
  • Re: referring to increasing VBA variable name in loop
    ... Dim PhraseAs String ... which are set equal to different words or phrases such as ... I can hard-code a variable name into the speech code such as: ... in a for loop, something like ...
    (microsoft.public.excel.programming)
  • Re: Supremes "Buy It Now" in eBays favor
    ... Other President's - in the modern era - have relied on teams of speech ... writers to come up with their great words and phrases. ...
    (alt.marketing.online.ebay)

Loading