+ Reply to Thread
Results 1 to 10 of 10

VBA code to stop screen from flickering does not work

Hybrid View

joy_ VBA code to stop screen from... 11-05-2012, 11:58 AM
Moonie Re: VBA code to stop screen... 11-05-2012, 01:48 PM
joy_ Re: VBA code to stop screen... 11-07-2012, 12:56 AM
WasWodge Re: VBA code to stop screen... 11-07-2012, 01:12 AM
joy_ Re: VBA code to stop screen... 11-07-2012, 03:16 AM
WasWodge Re: VBA code to stop screen... 11-07-2012, 03:37 AM
joy_ Re: VBA code to stop screen... 11-07-2012, 03:58 AM
WasWodge Re: VBA code to stop screen... 11-07-2012, 05:15 AM
joy_ Re: VBA code to stop screen... 11-07-2012, 07:20 AM
hawkdoc Re: VBA code to stop screen... 11-12-2012, 11:30 AM
  1. #1
    Registered User
    Join Date
    11-05-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    10

    VBA code to stop screen from flickering does not work

    Hi there,

    I have no clue why I can't use the "Application.ScreenUpdating = False/True" code on one of my macros. After I add them to the top and bottom of my macro code, the macro does not work anymore. In particular, the select function is removed and the macro is only left with the "ActiveWindow.SmallScroll Down:=-36".

    Here is the macro that does NOT work with the addition of the screen updating code:

    Sub GotoTop_Click()
    Application.ScreenUpdating = False
        ActiveWindow.SmallScroll Down:=-36
        Range("C1").Select
    Application.ScreenUpdating = True
    End Sub
    Here is a macro that worked perfectly alright with the addition of the screen updating code:

    Sub OverallFinancialPerformance_Click()
    Application.ScreenUpdating = False
        ActiveWindow.SmallScroll Down:=25
    Application.ScreenUpdating = True
    End Sub

    Please help!!!! THANKS SO MUCH!

    Moderator's Edit: Use code tags when you post code. To do so (for future use), select your code and click on the # icon above.
    Last edited by arlu1201; 11-05-2012 at 12:12 PM.

  2. #2
    Registered User
    Join Date
    08-15-2012
    Location
    Dayton, Ohio
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: VBA code to stop screen from flickering does not work

    I'm still learning but this worked for me after testing:

    Sub GotoTop_Click()
    Application.ScreenUpdating = False
        ActiveWindow.SmallScroll Down:=-36
    Application.ScreenUpdating = True
        Range("C1").Select
    End Sub

  3. #3
    Registered User
    Join Date
    11-05-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA code to stop screen from flickering does not work

    Hey Moonie! Thanks for your comment. I tried your way of coding but it doesn't work )): The screen still flickers ): Any other advice from anyone else?

    Thank you!!

  4. #4
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    883

    Re: VBA code to stop screen from flickering does not work

    The scrolldown doesn't serve any purpose.

    Application.ScreenUpdating = False
        Range("C1").Select
    Application.ScreenUpdating = True
    (and being honest turning off the screenupdating won't make any difference if you are just selecting a cell)
    If my solution worked (or not) please let me know. If your question is answered then please remember to mark it solved

    Computers are like air conditioners. They work fine until you start opening windows. ~Author Unknown

  5. #5
    Registered User
    Join Date
    11-05-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA code to stop screen from flickering does not work

    Ohh. okay thanks anyway! It's just the the screen flickering makes things look rather unstable :/
    It's a macro for a "Go to Top" button that is used repeatedly from different parts of the excel sheet, hence the need to select a cell at the end of the macro :/

  6. #6
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    883

    Re: VBA code to stop screen from flickering does not work

    It won't be the selecting of a single cell that is making the screen flicker, if you still have the flickering then really you should post the entire code.

  7. #7
    Registered User
    Join Date
    11-05-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA code to stop screen from flickering does not work

    Okay! This is my entire code without the screen updating code:

    Sub GotoTop_Click()
    ActiveWindow.SmallScroll Down:=-36
    Range("C1").Select
    End Sub

  8. #8
    Valued Forum Contributor WasWodge's Avatar
    Join Date
    08-02-2010
    Location
    Hampshire,England
    MS-Off Ver
    Office 365 and Office 2010
    Posts
    883

    Re: VBA code to stop screen from flickering does not work

    That is all the code is then it is literally just

    Sub GotoTop_Click()
    Range("C1").Select
    End Sub

  9. #9
    Registered User
    Join Date
    11-05-2012
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: VBA code to stop screen from flickering does not work

    OMG it works!!! Thanks so much WasWodge!

    Sorry, I'm a VBA newbie >< Trying to complete a school project

  10. #10
    Registered User
    Join Date
    10-05-2012
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: VBA code to stop screen from flickering does not work

    @Joy,
    The reason the screen was "flickering" is because you were telling it to scroll down 36 lines BEFORE going directly to cell C1. Terminology is everything in programming.. :-)

+ 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