+ Reply to Thread
Results 1 to 6 of 6

Macro for changing number of rows

  1. #1
    Registered User
    Join Date
    03-31-2010
    Location
    New York, New York
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Macro for changing number of rows

    Hello -

    So I'm a little less experienced than I thought.

    Below is my table.
    Please Login or Register  to view this content.
    My little macro orders the rows in descending order by column C, then orders the rows in descending order by Column B. But it's hard coded to 6 rows. I don't know how to make it apply to whether I have 30 records or 3,000 records. FYI, the number of columns will be fixed at 3 columns no matter how many records I have.

    Please Login or Register  to view this content.
    Any help would greatly be appreciated.

    Thanks for your help in advance.

    - DyingIsis
    Last edited by DyingIsis; 03-31-2010 at 11:27 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro for changing number of rows

    Welcome to the forum.

    Please take a few minutes to read the forum rules, and then edit your post to add CODE tags.

    Thanks.

    EDIT: Also, please explain what you're trying to do.
    Last edited by shg; 03-31-2010 at 11:20 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Macro for changing number of rows

    Try this:
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    03-31-2010
    Location
    New York, New York
    MS-Off Ver
    Excel 2007
    Posts
    2

    Question Re: Macro for changing number of rows

    shg, thank you thank you thank you!!!

    I'm trying to learn how to do this kind of thing on my own, but I'm obviously way inexperienced.

    Do you have any tips on reading materials or courses for someone who is trying to learn how to manipulate Macros via VBA?
    Last edited by shg; 04-01-2010 at 12:24 PM.

  5. #5
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Macro for changing number of rows

    try recording a macro it will give you some ideas.
    the one above by shg looks like this when recorded
    Please Login or Register  to view this content.
    you can then change the selection bit
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  6. #6
    Registered User
    Join Date
    10-15-2008
    Location
    Philippines
    MS-Off Ver
    2016
    Posts
    11

    Thumbs up Re: Macro for changing number of rows

    i also learn from here...thanks!
    Last edited by shg; 04-01-2010 at 12:25 PM. Reason: deleted spurious quote

+ Reply to Thread

LinkBacks (?)

  1. Page
    Refback This thread
    10-04-2013, 06:09 AM

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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