+ Reply to Thread
Results 1 to 6 of 6

Copy/Paste Range(s) without activating/selecting Range(s)

  1. #1
    Registered User
    Join Date
    10-01-2008
    Location
    LOs Angeles
    Posts
    7

    Copy/Paste Range(s) without activating/selecting Range(s)

    To initialize some cells/ranges, I am copying a given range and pasting it to another given range using the .Copy and .PaseSpecial methods.

    However, it would seem that both methods actually select the range(s) for the operations, i.e. the given ranges(s) are activated/selected thus changing the focus on the spreadsheet.

    I would like to perform both operations without actually selecting the given ranges ... what is the (obvious) way to do so?

    Thanks,
    Last edited by hmissoumi; 10-03-2008 at 01:35 PM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689
    Don't select:
    Please Login or Register  to view this content.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    10-01-2008
    Location
    LOs Angeles
    Posts
    7
    I am NOT selecting the Ranges: the .Copy method will move the focus to the range I want to copy ... AND that is what I want to avoid.

    Same for the .Pastespecial method

    More precisely, I do no want to move away from the currently active cell.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello hmissoumi,

    Here is an example that will copy the values from a range on Sheet1 to a range on Sheet2. The cell formats and formulas are not copied, just the values. The active cell remains untouched on both sheets.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Shg's code does not select any cell so the whatever cell is active will remain active.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  6. #6
    Registered User
    Join Date
    10-01-2008
    Location
    LOs Angeles
    Posts
    7
    Thanks Ross, that will do ... I have to use xRange.value = yRange.value

+ 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. 2D Array of named ranges
    By hilander in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-02-2008, 08:02 PM
  2. Working with two ranges
    By udigold1 in forum Excel General
    Replies: 1
    Last Post: 08-27-2008, 10:04 AM
  3. Combine two ranges into one
    By hodges5378 in forum Excel General
    Replies: 5
    Last Post: 04-22-2008, 02:03 PM
  4. Date ranges between date ranges
    By kwuk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-29-2007, 08:55 AM
  5. Named Ranges and Memory Usage
    By Rabk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-12-2007, 07:36 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