+ Reply to Thread
Results 1 to 4 of 4

Slow Macro execution

  1. #1
    Registered User
    Join Date
    04-01-2012
    Location
    Lewisville
    MS-Off Ver
    Excel 2010
    Posts
    3

    Slow Macro execution

    I have an Amortization Spread Sheet. I want to create a macro that will work faster than the one I have "recorded".

    Consider:
    360 Rows - on row for a 30 year mortgage x 12 months
    Month ONE begins in row 18
    Month 360 is row 377

    I want to hide the first 11 rows to show the end of year 1, then hide the next 11 rows to show end of year 2 and so on to get to the displaying of just the end of each year instead of the entire 360 rows.

    Using a form control button to launch the macro


    I have :
    Sub Hide_Month()
    '
    ' Hide_Month Macro
    ' Show 5 Year increments - Rick Parker
    '
    ' Keyboard Shortcut: Ctrl+Shift+M
    '
    Rows("18:28").Select
    Selection.EntireRow.Hidden = True
    Rows("30:40").Select
    Selection.EntireRow.Hidden = True
    Rows("42:52").Select
    Selection.EntireRow.Hidden = True
    Rows("54:64").Select
    Selection.EntireRow.Hidden = True
    Rows("66:76").Select
    Selection.EntireRow.Hidden = True
    Rows("78:88").Select
    Selection.EntireRow.Hidden = True
    Rows("90:100")
    ETC ETC.

    This macro is extremely slow is there a better way to hide alternating 348 rows.

    Appreciate all the help always.

    Excel 2010
    Citrix Server thin client
    Rookie Macro Dude
    Rick

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Slow Macro execution

    rickparker,

    Give this a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: Slow Macro execution

    Wellcome to the Forum,

    can you please use code tags around code.

    Posting code without them makes your code hard to read and difficult to be copied for testing. Select your code and click the [#] button at the top of the post window (if you are editing an existing post, press Go Advanced to see the [#] button). The result will appear like this in the post window:

    Please Login or Register  to view this content.
    ... and appear like this when posted:

  4. #4
    Registered User
    Join Date
    04-01-2012
    Location
    Lewisville
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Slow Macro execution

    Solved. . .much faster.

+ 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