+ Reply to Thread
Results 1 to 12 of 12

Help with macro to text out Active sheet and sort data in specific column

  1. #1
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Help with macro to text out Active sheet and sort data in specific column

    Good evening,

    I am trying to write a macro to text out an active worksheet in a workbook and at the same time the macro should be able to sort out the EBITDA data in column R from largest to smallest number up until row 25. The range of data to be sorted is A14:R24 but only column R needs to be sorted from largest to smallest.
    I was hoping someone could assist me with this macro since what I came up with did a sloppy job.

    Please see attached SampleX file

    Thank you.
    Pi
    Attached Files Attached Files

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

    Re: Help with macro to text out Active sheet and sort data in specific column

    to text out an active worksheet in a workbook
    What does this mean? Please explain in simple language.

    If you only sort columns A:R, then won't that create problems with columns T:X?
    Last edited by alansidman; 07-17-2015 at 09:54 PM.
    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
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help with macro to text out Active sheet and sort data in specific column

    My apologies. What I meant by Active worksheet is, that sheet in the workbook has a lot of formulas in there and is updated on a daily basis so I was hoping to get help with a macro that will text out that worksheet after it is updated and also the macro sorts out the BOP data in column R from largest to smallest. And you are right as is sorts out the data in column R the data in other columns/rows would sort accordingly too.
    I apologies for my vague question before.

    Thank you again.

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

    Re: Help with macro to text out Active sheet and sort data in specific column

    Try this:

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help with macro to text out Active sheet and sort data in specific column

    Thank you Alansidman for your time. I replied earlier when you replied with the macro but I can't seem to find it all the same thank you but is it possible to edit the macro so it makes a text copy (duplicate tab) of the SampleX tab before sorting column R and also if the macro can skip rows 25 through 27 and sort the Tips and Gifts row from largest to smallest in column R also I will appreciate it.

    I tried to edit it myself but was unsuccessful.
    Thank you very much.

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

    Re: Help with macro to text out Active sheet and sort data in specific column

    Ok. Try this:

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help with macro to text out Active sheet and sort data in specific column

    It works but it is possible for the "TxtSheet" it creates to be in the same format and style as the original SampleX tab? meaning to create an exact replica/duplicate (ie all hidden rows or columns should remain hidden as the original and keep original formatting)

    Thank you Alansidman.
    Last edited by Pi*; 07-18-2015 at 07:59 PM.

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

    Re: Help with macro to text out Active sheet and sort data in specific column

    It is possible, but it will take a lot of detailed coding. I suggest you attempt to do it using the macro recorder and post back with any issues you may have. Alternatively, you could post in the commercial services section and pay someone to do this. We are all volunteers here with limited amount of time to dedicate to helping folks like yourself and this is a bigger (read: time consuming) task than I am willing to undertake. Maybe someone else will step up?

  9. #9
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Help with macro to text out Active sheet and sort data in specific column

    Is this how you wanted?
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help with macro to text out Active sheet and sort data in specific column

    Thank you VERY much Jindon. Works PERFECT!

    I appreciate your time and help. I will look into taking more tutorials myself.

    Best Regards,

    Pi

  11. #11
    Forum Contributor
    Join Date
    03-17-2013
    Location
    USA, IL
    MS-Off Ver
    Excel 2010
    Posts
    121

    Re: Help with macro to text out Active sheet and sort data in specific column

    Hi Alansidman,

    You were very helpful and I learnt a few ingenious tricks from you.

    Thank you Sir and thanks for the advice.

    Pi

  12. #12
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,835

    Re: Help with macro to text out Active sheet and sort data in specific column

    You are welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. make a sort by active sheet, not specific sheet
    By tsiguy96 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2014, 11:25 AM
  2. Replies: 20
    Last Post: 01-11-2014, 05:39 AM
  3. Replies: 1
    Last Post: 01-04-2014, 06:37 PM
  4. Copy the data in any active row in Sheet 1 to specific cells in Sheet 6
    By cti4sw in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-04-2013, 02:43 PM
  5. [SOLVED] How to get (range)macro to always run code on a specific sheet regardless of active sheet?
    By JTwrk in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-18-2012, 04:33 PM
  6. Macro to sort worksheet by the column of the active cell
    By AlaskaJim in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-11-2008, 11:00 PM
  7. Macro to Sort Active Sheet and Set Page Breaks on Columns?
    By misscrf in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-12-2007, 11:02 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