+ Reply to Thread
Results 1 to 2 of 2

Selecting n rows in the adjacent column

Hybrid View

  1. #1
    Registered User
    Join Date
    02-22-2008
    Location
    Utah
    Posts
    10

    Selecting n rows in the adjacent column

    I have some data, in 405 columns. I'm trying to combine them in to one column. My only hangup is moving from one selection in a column to the next selection in the next column.

    I know I can iterate to the next column with a loop:

    For i = 1 To 405
      Columns(i).Select
    But that grabs the entire column. I just want to grab rows 1-10. How can I go about doing that?

    Example:
    1  6
    2  7
    3  8
    4  9
    5  0
    Would turn out like:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    0
    Make sense?

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: Selecting n rows in the adjacent column

    Hi

    here goes

    Sub aaa()
      For i = 2 To Cells(1, Columns.Count).End(xlToLeft).Column
        Cells(1, i).Resize(10, 1).Cut Destination:=Cells(Rows.Count, 1).End(xlUp).Offset(1, 0)
      Next i
    End Sub
    rylo

+ 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