+ Reply to Thread
Results 1 to 4 of 4

How to Concatenate a variable name in a vba loop ?

  1. #1
    tmb
    Guest

    How to Concatenate a variable name in a vba loop ?

    Const Value1 as long = 5
    Const Value2 as long = 12
    Const Value3 as long = 7

    For i = 1 to 3
    MsgBox Value & i '<-- How to do this properly?
    Next i

    I want MsgBox to display 5 then 12 then 7
    I can't figgure out how to get Value and i to combine properly to do this.

    thanks for any help.

    PS - This is a repost as I didn't ask the question correctly last time.



  2. #2
    Bob Phillips
    Guest

    Re: How to Concatenate a variable name in a vba loop ?

    But you are happy with the last answer you got?

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "tmb" <[email protected]> wrote in message
    news:u%[email protected]...
    > Const Value1 as long = 5
    > Const Value2 as long = 12
    > Const Value3 as long = 7
    >
    > For i = 1 to 3
    > MsgBox Value & i '<-- How to do this properly?
    > Next i
    >
    > I want MsgBox to display 5 then 12 then 7
    > I can't figgure out how to get Value and i to combine properly to do this.
    >
    > thanks for any help.
    >
    > PS - This is a repost as I didn't ask the question correctly last time.
    >
    >




  3. #3
    tmb
    Guest

    Re: How to Concatenate a variable name in a vba loop ?

    I am happy Bob.

    thanks for the help.

    "Bob Phillips" <[email protected]> wrote in message
    news:[email protected]...
    > But you are happy with the last answer you got?
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "tmb" <[email protected]> wrote in message
    > news:u%[email protected]...
    >> Const Value1 as long = 5
    >> Const Value2 as long = 12
    >> Const Value3 as long = 7
    >>
    >> For i = 1 to 3
    >> MsgBox Value & i '<-- How to do this properly?
    >> Next i
    >>
    >> I want MsgBox to display 5 then 12 then 7
    >> I can't figgure out how to get Value and i to combine properly to do
    >> this.
    >>
    >> thanks for any help.
    >>
    >> PS - This is a repost as I didn't ask the question correctly last time.
    >>
    >>

    >
    >




  4. #4
    Bob Phillips
    Guest

    Re: How to Concatenate a variable name in a vba loop ?

    That's okay, just checking as the times seemed to suggest this came after
    the last posting.

    Regards

    Bob


    "tmb" <[email protected]> wrote in message
    news:[email protected]...
    > I am happy Bob.
    >
    > thanks for the help.
    >
    > "Bob Phillips" <[email protected]> wrote in message
    > news:[email protected]...
    > > But you are happy with the last answer you got?
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "tmb" <[email protected]> wrote in message
    > > news:u%[email protected]...
    > >> Const Value1 as long = 5
    > >> Const Value2 as long = 12
    > >> Const Value3 as long = 7
    > >>
    > >> For i = 1 to 3
    > >> MsgBox Value & i '<-- How to do this properly?
    > >> Next i
    > >>
    > >> I want MsgBox to display 5 then 12 then 7
    > >> I can't figgure out how to get Value and i to combine properly to do
    > >> this.
    > >>
    > >> thanks for any help.
    > >>
    > >> PS - This is a repost as I didn't ask the question correctly last time.
    > >>
    > >>

    > >
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1