+ Reply to Thread
Results 1 to 2 of 2

Automate cell selection

  1. #1
    Registered User
    Join Date
    06-08-2006
    Posts
    3

    Automate cell selection

    Hi,
    How do I automate cell selection? For example if I want to select cells A1,C1 and E1 then A2,C2,E2 and so on,each time using the data stored in these cells.

    Thanks,
    Mayank.

  2. #2
    Tom Ogilvy
    Guest

    RE: Automate cell selection

    Sub DemoApproach()
    Dim i As Long, rng As Range
    Dim cell As Range, sStr As String
    For i = 1 To 10
    Set rng = Cells(i, 1).Range("A1,C1,E1")
    ' msgbox rng.Address
    For Each cell In rng
    sStr = sStr & cell.Address(0, 0) & ","
    Next
    sStr = Left(sStr, Len(sStr) - 1)
    sStr = sStr & vbNewLine
    Next
    MsgBox sStr
    End Sub

    --
    Regards,
    Tom Ogilvy

    "mayanklal" wrote:

    >
    > Hi,
    > How do I automate cell selection? For example if I want to select cells
    > A1,C1 and E1 then A2,C2,E2 and so on,each time using the data stored in
    > these cells.
    >
    > Thanks,
    > Mayank.
    >
    >
    > --
    > mayanklal
    > ------------------------------------------------------------------------
    > mayanklal's Profile: http://www.excelforum.com/member.php...o&userid=35236
    > View this thread: http://www.excelforum.com/showthread...hreadid=551035
    >
    >


+ 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