+ Reply to Thread
Results 1 to 4 of 4

Selecting Ranges

  1. #1
    Barb Reinhardt
    Guest

    Selecting Ranges

    I want to select the following range:

    Range("BW2:CF2").Select

    However, I want to be able to change the 2 to a different number
    programmatically using i as the variable.

    I've tried

    Range("BW"&i ":CF"&i).Select

    and it just doesn't work. What am I doing wrong?

    Thanks,
    Barb Reinhardt

  2. #2
    Jim Thomlinson
    Guest

    RE: Selecting Ranges

    You are missing one "&"

    Range("BW" & i & ":CF" & i).Select
    --
    HTH...

    Jim Thomlinson


    "Barb Reinhardt" wrote:

    > I want to select the following range:
    >
    > Range("BW2:CF2").Select
    >
    > However, I want to be able to change the 2 to a different number
    > programmatically using i as the variable.
    >
    > I've tried
    >
    > Range("BW"&i ":CF"&i).Select
    >
    > and it just doesn't work. What am I doing wrong?
    >
    > Thanks,
    > Barb Reinhardt


  3. #3
    Trevor Shuttleworth
    Guest

    Re: Selecting Ranges

    Barb

    close ... try:

    Range("BW" & i & ":CF" & i).Select

    or

    Range(Cells(i, "BW"), Cells(i, "CF")).Select

    Regards

    Trevor


    "Barb Reinhardt" <BarbReinhardt@discussions.microsoft.com> wrote in message
    news:423A1148-C78E-48F8-A725-6AC04F30671D@microsoft.com...
    >I want to select the following range:
    >
    > Range("BW2:CF2").Select
    >
    > However, I want to be able to change the 2 to a different number
    > programmatically using i as the variable.
    >
    > I've tried
    >
    > Range("BW"&i ":CF"&i).Select
    >
    > and it just doesn't work. What am I doing wrong?
    >
    > Thanks,
    > Barb Reinhardt




  4. #4
    Barb Reinhardt
    Guest

    RE: Selecting Ranges

    I looked and looked for that. Don't ask me why I missed it.

    Thanks! I knew someone here would find it quickly.

    "Jim Thomlinson" wrote:

    > You are missing one "&"
    >
    > Range("BW" & i & ":CF" & i).Select
    > --
    > HTH...
    >
    > Jim Thomlinson
    >
    >
    > "Barb Reinhardt" wrote:
    >
    > > I want to select the following range:
    > >
    > > Range("BW2:CF2").Select
    > >
    > > However, I want to be able to change the 2 to a different number
    > > programmatically using i as the variable.
    > >
    > > I've tried
    > >
    > > Range("BW"&i ":CF"&i).Select
    > >
    > > and it just doesn't work. What am I doing wrong?
    > >
    > > Thanks,
    > > Barb Reinhardt


+ 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