+ Reply to Thread
Results 1 to 7 of 7

Need help in writing a Macro to sort the columns in the worksheet

  1. #1
    Registered User
    Join Date
    03-07-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    12

    Need help in writing a Macro to sort the columns in the worksheet

    Hi

    I have two sheets in my workbook...Let say Sheet2 and Sheet3

    I am trying to copy the data from a workbook and pasting the data in sheet2 and sheet3


    I have a Macro Button for sheet2 if click the button it has to sort the columns in ascending order....and doesent want to give any range because the count of columns will be increasing so ia want a code to be dynamic.

    Please advise

  2. #2
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Need help in writing a Macro to sort the columns in the worksheet

    Hi Shanvin,

    Which column you want to sort in ascending order first. Could you please attach the sample file, so that look at it.

    Cheers,
    Joshi
    Cheers,

    Joshi
    Being with a winner makes you a winner

  3. #3
    Registered User
    Join Date
    03-07-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Need help in writing a Macro to sort the columns in the worksheet

    Hi Joshi,

    As i said Before I have two sheets where in both the sheets the data will be the same

    where while extract the sheet sometime data will be not sorted in any of one sheet so what we used to do is we will sort all the columns in both the sheets to ascending order and then try to compare the sheets

    Regards
    Vinoth
    Last edited by shanvin; 03-21-2013 at 11:20 AM.

  4. #4
    Forum Contributor
    Join Date
    10-30-2011
    Location
    Doha
    MS-Off Ver
    MS office 365
    Posts
    701

    Re: Need help in writing a Macro to sort the columns in the worksheet

    Hi Vinoth,

    Try the attached file.


    If you're satisfied by any members response please use the star icon at the lower left of their post.
    In the event Code provided resolves your issue, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    If you have issues with Code I've provided, I appreciate your feedback.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-07-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Need help in writing a Macro to sort the columns in the worksheet

    Thanks Joshi Macro worked

  6. #6
    Registered User
    Join Date
    03-07-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Need help in writing a Macro to sort the columns in the worksheet

    Hi Joshi,

    I was using the Below Macro to Compare the data in Sheet1 and Sheet2 of a work book

    Please Login or Register  to view this content.

    But If the data is Huge let say more than 1 Lakh then macro keeps on Running.
    Can You Help me in this?


    And also You can advise me on the below

    Right now we have two systems where we are extracting the data in excel sheet
    So we have two Excel sheet and both contains the same data but data is huge let say it can cross over 5 lakhs .So advise me what will be the best approach to compare both sheets?

    Regards
    Shanvin

  7. #7
    Registered User
    Join Date
    03-07-2013
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Need help in writing a Macro to sort the columns in the worksheet

    I just Want to know how many rows and columns that we can compare using macro?

    Is it possible to compare 7 lakh record in a macro?

+ 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