+ Reply to Thread
Results 1 to 3 of 3

loop syntax

  1. #1
    Knox
    Guest

    loop syntax

    can someone correct the syntax in the last line below. Thank you

    I just want C(24*i+2):C(24*i+25) to be selected. thanx

    Dim i As Long
    For i = 1 To 1
    Range("C" & 24 * i + 2:"C" & 24 * i + 25).Select

  2. #2
    Knox
    Guest

    RE: loop syntax

    nevermind i got it

    Range(("C" & 24 * i + 2), ("C" & 24 * i + 25)).Select

    thanx

    "Knox" wrote:

    > can someone correct the syntax in the last line below. Thank you
    >
    > I just want C(24*i+2):C(24*i+25) to be selected. thanx
    >
    > Dim i As Long
    > For i = 1 To 1
    > Range("C" & 24 * i + 2:"C" & 24 * i + 25).Select


  3. #3
    Dave Peterson
    Guest

    Re: loop syntax

    Maybe:

    Range("C" & 24 * i + 2 & ":C" & 24 * i + 25).Select
    Or
    Cells(24 * i + 2, "C").Resize(24, 1).Select
    or
    Range("C" & 24 * i + 2).Resize(24, 1).Select

    I like the middle one!


    Knox wrote:
    >
    > can someone correct the syntax in the last line below. Thank you
    >
    > I just want C(24*i+2):C(24*i+25) to be selected. thanx
    >
    > Dim i As Long
    > For i = 1 To 1
    > Range("C" & 24 * i + 2:"C" & 24 * i + 25).Select


    --

    Dave Peterson

+ 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