Results 1 to 3 of 3

Assigning Value to Concatenated Variable

Threaded View

  1. #1
    Registered User
    Join Date
    06-26-2007
    Posts
    1

    Assigning Value to Concatenated Variable

    PLEASE ALWAYS WRAP CODE

    Hi,

    I'm trying to assign a value to a variable within a for-next loop as i don't want to repeat the same code over and over again.
    For n = 1 To 12
        If "Break" + n + "End" = "" Then
        "Break" & n & "End" = Counter1 + 13
        End If
    Next n
    So, I have declared 12 variables as strings (ie: Break1End, Break2End, etc).

    Is it possible to do something similar to the above? I can't seem to be able to find the right syntax to allow the vba editor in excel to accept the portion of code where I want to assign the value. Theoretically it makes sense to me but I am not sure.

    I guess I don't have to simplify things using a loop but I would like to.

    Thanks!

    -A
    Last edited by VBA Noob; 06-26-2007 at 02:06 PM.

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