View Single Post
  #2 (permalink)  
Old June 13th, 2006, 01:45 PM
BrianWren BrianWren is offline
Friend of Wrox
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

(i) In VB (which for these purposes is synonymous with VBA), to join information that varies with what is called a "literal string," use the ampersand.

So let's say you had a variable called vbr that you need to use as values from 1 to 10, each time joining it to the end of "This is pass number ". You might do that like this:
    Dim vbr As Integer
    Dim s   As String

    For vbr = 1 To 10
        s = "This is pass number " & vbr
        ' Do some stuff with s here . . .
    Next vbr

(ii) Please expound.