Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,202
Default referring to increasing VBA variable name in loop

If I change the XL reference to Application, then it works in XL2007 also.

Rick

"Dave Peterson" wrote in message
...
It worked fine for me in xl2003.



Alan Beban wrote:

wrote:
I guess great minds think alike since everyone recommended the array,
thanks!


I make no claim for its utility, but I'm curious whether the following
works (I don't have a more current version of xl):

Sub abtest4()
Names.Add Name:="phrase1", RefersTo:="Hello"
Names.Add Name:="phrase2", RefersTo:="Goodbye"
For i = 1 To 2
XL.Speech.Speak Evaluate("phrase" & i)
Next
End Sub


--

Dave Peterson


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default referring to increasing VBA variable name in loop

Rick Rothstein (MVP - VB) wrote:
If I change the XL reference to Application, then it works in XL2007 also.

Rick


Thanks for the feedback.

Alan

"Dave Peterson" wrote in message
...

It worked fine for me in xl2003.



Alan Beban wrote:


wrote:
I guess great minds think alike since everyone recommended the array,
thanks!

I make no claim for its utility, but I'm curious whether the following
works (I don't have a more current version of xl):

Sub abtest4()
Names.Add Name:="phrase1", RefersTo:="Hello"
Names.Add Name:="phrase2", RefersTo:="Goodbye"
For i = 1 To 2
XL.Speech.Speak Evaluate("phrase" & i)
Next
End Sub



--

Dave Peterson



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default referring to increasing VBA variable name in loop

Dave Peterson wrote:
It worked fine for me in xl2003.


Thanks for the feedback.

Alan


Alan Beban wrote:

wrote:

I guess great minds think alike since everyone recommended the array,
thanks!


I make no claim for its utility, but I'm curious whether the following
works (I don't have a more current version of xl):

Sub abtest4()
Names.Add Name:="phrase1", RefersTo:="Hello"
Names.Add Name:="phrase2", RefersTo:="Goodbye"
For i = 1 To 2
XL.Speech.Speak Evaluate("phrase" & i)
Next
End Sub



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Referring to a variable file name Brettjg Excel Discussion (Misc queries) 4 March 3rd 07 11:18 AM
Referring to multiple worksheets via a variable dc_area_mcse[_2_] Excel Programming 2 October 5th 06 03:36 PM
Referring to a Worksheet with a variable donbowyer Excel Programming 7 September 19th 06 12:49 AM
Increasing a range in a loop ric Excel Programming 4 April 26th 04 07:59 PM
Referring to a worksheet using variable WSF Excel Programming 5 January 20th 04 03:16 PM


All times are GMT +1. The time now is 11:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"