Results 1 to 21 of 21

Application.screenupdating causing program lagg

Threaded View

  1. #1
    Forum Contributor
    Join Date
    06-14-2010
    Location
    Toronto,Canada
    MS-Off Ver
    Excel 2003
    Posts
    145

    Application.screenupdating causing program lagg

    Hi,
    I made a program in Private Sub Worksheet_SelectionChange(ByVal Target As Range) event, so it will run some code everytime i select a cell.

    The problem is, I get a lagg (ie, the excel sheet "flashes") everytime i click on a cell.
    I am 100% sure the problem is caused by application.screenupdating, since if I remove that line, I don;t lagg; I get instant response
    Private Sub Worksheet_SelectionChange(ByVal Target As Range)
    
        Application.ScreenUpdating = False
        'some code here
        'checked with Debug.Print Application.ScreenUpdating, which shows FALSE, just as it's supposed to
    
    
        'some more code here
        'checked again with Debug.Print Application.ScreenUpdating, which shows FALSE, just as it's supposed to
    
        'checked with Debug.Print Application.ScreenUpdating, which shows FALSE, just as it's supposed to
        Application.ScreenUpdating = True
        'checked with Debug.Print Application.ScreenUpdating, which shows TRUE, just as it's supposed to
    End Sub
    Any help would be appciated
    Thanks
    Last edited by adds007; 08-20-2010 at 12:56 PM.

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