+ Reply to Thread
Results 1 to 2 of 2

worksheets("ABC").select and the screen will focus on it

Hybrid View

  1. #1
    Registered User
    Join Date
    01-27-2009
    Location
    Australia
    MS-Off Ver
    Excel 2002, 2010
    Posts
    42

    worksheets("ABC").select and the screen will focus on it

    Hi all,

    I am writing a simple macro to conditionally copy some data from one workSheet to another workSheet in the same Excel file.
    Here is the code:
    Dim KWS As Worksheet
    Dim JWS As Worksheet
    
    Set KWS = Worksheets("Kitty")
    Set JWS = Worksheets("Jan")
    
    For x = beginning_cell To 5
    If KWS.Cells(x, 8).Value = JWS.Cells(1, 8).Value Then
    Sheets("Kitty").Select
    KWS.Range(Cells(x, 1), Cells(x, 18)).Copy
    Sheets("Jan").Select
    JWS.Range("A"&x).PasteSpecial
    Application.CutCopyMode = False
    End If
    Next x
    When the code is executed, I saw the screen was blinking with two worsheets kept switching.
    Is it possible to make the screen focus on the Kitty worksheet while the code is excuting? I don't want to see the screen blinking.

    I am new to macro programming.
    Please help and advise.
    Thanks
    Kitty

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: worksheets("ABC").select and the screen will focus on it

    At the beginning of your code, put -
    Application.ScreenUpdating = False
    Before the End Sub, put -
    Application.ScreenUpdating=True

+ 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