+ Reply to Thread
Results 1 to 6 of 6

All cells in one column in order

Hybrid View

  1. #1
    Registered User
    Join Date
    09-05-2012
    Location
    Türkiye
    MS-Off Ver
    Excel 2013
    Posts
    80

    All cells in one column in order

    Hi,
    I need to put all cells in A column in order.first copy first row in A1,then second,third rows... in A column .if A column exceeded 1,000,000 rows continue to b column .
    in sample page 1 is original,page 2 is what is needed.in order.xlsx
    cells have both text and numbers.(not only numbers)
    Last edited by zeroist; 12-04-2013 at 09:30 AM.

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2504 Win 11
    Posts
    24,704

    Re: All cells in one column in order

    What is the maximum number of cells that will have to be transposed. You indicated that if it exceeds 1MM that you need to have data continue on to Column B. Would it possibly exceed 2MM?
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    09-05-2012
    Location
    Türkiye
    MS-Off Ver
    Excel 2013
    Posts
    80

    Re: All cells in one column in order

    it has 200,000 rows and 19 columns. so 200,000*19=3,800,000 cells has to be ordered in column in A and B even in C.

  4. #4
    Registered User
    Join Date
    09-05-2012
    Location
    Türkiye
    MS-Off Ver
    Excel 2013
    Posts
    80

    Re: All cells in one column in order

    What does it make hard? I can divide 200,000 rows into two part.So just column A and B is enough for 1,900,000 cells.

  5. #5
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: All cells in one column in order

    Hi zeroist,
    maybe so
    Sub ertert()
    Dim x, y(), i&, j&, k&, n&
    Application.ScreenUpdating = False
    x = Sheets("Sayfa1").Range("A1").CurrentRegion.Value
    Const ch As Long = 1000000: ReDim y(1 To ch, 1 To 1)
    For i = 1 To UBound(x)
        For j = 1 To UBound(x, 2)
            k = k + 1
            If k > ch Then
                n = n + 1
                Sheets("Sayfa2").Cells(1, n).Resize(ch).Value = y()
                k = 1
            End If
            y(k, 1) = x(i, j)
        Next j
    Next i
    If k < ch Then Sheets("Sayfa2").Cells(1, n + 1).Resize(k).Value = y()
    Application.ScreenUpdating = True
    End Sub

  6. #6
    Registered User
    Join Date
    09-05-2012
    Location
    Türkiye
    MS-Off Ver
    Excel 2013
    Posts
    80

    Re: All cells in one column in order

    Thank you so much.it seems working.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Formula Problems With Cells In Same Coloum
    By Mooseman60 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-24-2011, 07:42 AM
  2. [SOLVED] how do i count the number of cells used in a coloum?
    By mjm in forum Excel General
    Replies: 1
    Last Post: 08-07-2006, 03:15 PM
  3. Replies: 1
    Last Post: 08-07-2006, 12:25 PM
  4. [SOLVED] Identify duplicate coloum A cells, and merge their row and text in
    By Calla212 in forum Excel General
    Replies: 3
    Last Post: 03-30-2006, 05:11 PM
  5. [SOLVED] i want display the last coloum value in first coloum
    By sajid in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2006, 11:15 AM

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