+ Reply to Thread
Results 1 to 2 of 2

Incrementing columns

  1. #1
    Forum Contributor
    Join Date
    02-24-2005
    Posts
    154

    Incrementing columns

    Incrementing rows in VB is of cause easy as they are numbered but how can I increment columns as they are alphabetical?
    Even if I change to R1C1 reference style, how can I relate to the columns and increment them?

    Example
    For n = 1 To 10
    Sheets("Sheet1").Range("A" & n) = "Test"
    Next n

    This would put the word "Test" in cells "A1" to "A10"

    Supposing I wanted to put the word "Test" in cells "A1" to "K1"
    How would my program be written then?
    Last edited by grahammal; 11-11-2005 at 11:57 AM.

  2. #2
    Niek Otten
    Guest

    Re: Incrementing columns

    sheets("sheet1").cells(15,20)

    --
    Kind regards,

    Niek Otten

    "grahammal" <[email protected]> wrote
    in message news:[email protected]...
    >
    > Incrementing rows in VB is of cause easy as they are numbered but how
    > can I increment columns as they are alphabetical?
    > Even if I change to R1C1 reference style, how can I relate to a cell?
    > Normally the reference Sheets("Sheet1").Range("A1").Select is OK
    > but in R1C1 format, cell "A1" becomes "R1C1". VB dos'nt seem to
    > recognise this.
    > What do I put in the same command instead of ""A1"?
    >
    >
    > --
    > grahammal
    > ------------------------------------------------------------------------
    > grahammal's Profile:
    > http://www.excelforum.com/member.php...o&userid=20336
    > View this thread: http://www.excelforum.com/showthread...hreadid=484299
    >




+ 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