Consulting

Results 1 to 9 of 9

Thread: De-selecting cells after Paste

  1. #1
    VBAX Regular
    Joined
    Apr 2019
    Location
    London
    Posts
    25
    Location

    De-selecting cells after Paste

    I am copying several ranges from one sheet to 5 other sheets.
    Is there an easy way to de-select the copied sells in the 5 WSs?
    (all the copied cells remain shaded after sub completed)
    I realize I can select a single cell in each of the WSs but that seems cumbersome.
    Thanks.

  2. #2
    VBAX Wizard
    Joined
    Apr 2007
    Posts
    6,943
    Location
    Application.CutCopyMode=false will 'unselect' the original copied cells


    Paul

    ------------------------------------------------------------------------------------------------------------------------
    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s)
    (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Regular
    Joined
    Apr 2019
    Location
    London
    Posts
    25
    Location
    Thank you, Paul.

  4. #4
    VBAX Regular
    Joined
    Apr 2019
    Location
    London
    Posts
    25
    Location
    I am familiar with Application.CutCopyMode=false and already use it.
    I'm trying to unshade the pasted cells, which seems to remain after the sub ends.

  5. #5
    VBAX Regular pike's Avatar
    Joined
    Dec 2007
    Location
    Alstonville, Australia
    Posts
    94
    Location
    H Kerry,
    just
    Range("A1").Select

  6. #6
    VBAX Regular
    Joined
    Apr 2019
    Location
    London
    Posts
    25
    Location
    pike,

    I was trying to avoid doing that on 5 different sheets, given that some coders fret about using "select".
    Is there any need to get rid of the shading?
    I'm assuming that some users will not know enough about excel to do it manually and, thus, be worried about it.

    Thanks, Kerry

  7. #7
    VBAX Regular pike's Avatar
    Joined
    Dec 2007
    Location
    Alstonville, Australia
    Posts
    94
    Location
    Kerry,
    you can avoid it with
    paste range = copy range
    Range(“B1:B10”).value= Range(“A1:A10”).value

  8. #8
    VBAX Mentor
    Joined
    Apr 2009
    Location
    Kingsbury
    Posts
    423
    Location
    As Paul said
    Application.CutCopyMode = False
    make sure it refers to the sheet you are coping from otherwise it doesn't work

    Rob

    Last edited by Rob342; 04-25-2019 at 03:39 AM.

  9. #9
    VBAX Regular
    Joined
    Apr 2019
    Location
    London
    Posts
    25
    Location
    Thank you Rob

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •