+ Reply to Thread
Results 1 to 2 of 2

cycle Columns, how?

  1. #1
    Registered User
    Join Date
    10-11-2006
    Posts
    8

    cycle Columns, how?

    How can i cycle through columns using vba, looping they rows is easy as its a number and i can add 1 to go to next row but column is an alphabet, how can i go to next column from a reference cell.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    Columns can be refered to by numbers as well as letters.
    here is a couple of ways

    Dim iCol As Integer
    For iCol = 1 To 10
    MsgBox Cells(1, iCol).Value
    Next ifor

    For iCol = 1 To 10
    MsgBox Range("a1").Offset(0, ifor).Value
    Next ifor

+ 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