Results 1 to 6 of 6

Thread: I bet none of you VB masters can answer this

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Posts
    23

    Exclamation

    How do you reference columns in excel by a number.

    Case in point:

    do while x < 10
    range("A1", 5).value = x
    x = x+1
    loop

    I need to increment that A1 to B1 and then C1 and so on.

    Any help?

    Steve
    Stephen Warker

  2. #2
    Frenzied Member
    Join Date
    Sep 1999
    Location
    Phoenix, az
    Posts
    1,517

    hmm.

    Hi,

    Just some information.
    If you intend to get a
    responce you probably
    should put everyone
    down than ask the question.

    A hint.


  3. #3
    Fanatic Member
    Join Date
    Aug 2000
    Posts
    617

    ?!

    Just a quick idea....
    U have to fix a bit

    li_Counter = 1
    Do While li_Counter < 10
    Debug.Print UCase(Chr(65 + li_Counter)) & "1"
    range(UCase(Chr(65 + li_Counter)) & "1",5).value = x
    li_Counter = li_Counter + 1
    Loop

    U may have to add the chr value for the quot mark around


  4. #4
    Junior Member
    Join Date
    Oct 2000
    Posts
    18

    Use R1C1?

    If you just want to move over one column at a time, use the R1C1 reference style in your programming.

  5. #5
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Evan:
    For what it's worth, it's called "Child Psychology"



    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  6. #6
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    The best way to reference cells in Excel using row and columns, use Cells(Your Row, Your Column).Select


    This question is elementary, don't even need a VB master to answer it.
    Chemically Formulated As:
    Dr. Nitro

Posting Permissions

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



Click Here to Expand Forum to Full Width