+ Reply to Thread
Results 1 to 7 of 7

Trying to clean up this code and use screen updating

  1. #1
    Forum Contributor
    Join Date
    06-02-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    235

    Trying to clean up this code and use screen updating

    Every time I try and clean up this code it only clears the cells on the first tab instead of all (Mon-Sun). Also I don't know why but I cannot get screen updating and GoTo Ring working. I don't like the flickering and want the code to return to active cell after running.

    Here is the code, any help is GREATLY APPRECIATED!

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,521

    Re: Trying to clean up this code and use screen updating

    Do a Google search on why one should not use select in Excel.
    Let us know what you discovered and in the meantime I'll see to change your code.
    I'll wait for your answer first though.

  3. #3
    Valued Forum Contributor
    Join Date
    12-22-2015
    Location
    HK
    MS-Off Ver
    2010
    Posts
    532

    Re: Trying to clean up this code and use screen updating

    just guessing:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,521

    Re: Trying to clean up this code and use screen updating

    No need for screen updating and returning to original cell because nothing moves.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-02-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    235

    Re: Trying to clean up this code and use screen updating

    Ok I have been researching this. I am a novice and have issues with code when looping through multiple sheets. Going to try your code now, thank you for being patient

    GOOGLE >> There are multiple issues with using .Select here:

    The worksheet is not always specified. This happens if you don't switch worksheets while recording, and means that the code will yield different results for different active worksheets.
    .Select() is slow. Even if Application.ScreenUpdating is set to False, this is an unneccessary operation to be processed.
    .Select() is unruly. If Application.ScreenUpdating is left to True, Excel will actually select the cells, the worksheet, the form... whatever it is you're working with. This is stressful to the eyes and really unpleasant to watch.
    .Select() will trigger listeners. This is a bit advanced already, but unless worked around, functions like Worksheet_SelectionChange() will be triggered.

  6. #6
    Forum Contributor
    Join Date
    06-02-2014
    Location
    USA
    MS-Off Ver
    Office 365
    Posts
    235

    Re: Trying to clean up this code and use screen updating

    OK that worked perfectly! Thank you guys!!

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,521

    Re: Trying to clean up this code and use screen updating

    My apologies.
    The thing I wanted to stress is that the use of "With.....End With" is preferred over selecting as you can see in both of our codes.
    And of course all the other negative things you found out yourself.
    Good luck and thanks for coming back to let us know.

+ 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. [SOLVED] Screen updating and enable events code
    By dummy777 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-28-2019, 05:37 AM
  2. Help Needed with Screen Updating Code
    By RHONDAK72 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-13-2018, 04:20 AM
  3. Excel 2016 screen flashing between two workbooks despite screen updating turned off
    By Cumberland in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-29-2016, 03:07 PM
  4. Screen Updating = False not working - need help to remove .select from code?
    By jaimelwilson in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-01-2014, 08:58 PM
  5. Replies: 4
    Last Post: 01-23-2014, 07:05 AM
  6. [SOLVED] VBA Code to optimize and clean data- clean out numerical/ or symbol
    By tracylsr in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-05-2012, 04:21 PM
  7. Screen Updating
    By nidovan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-16-2005, 06:58 PM

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