+ Reply to Thread
Results 1 to 4 of 4

Moving Data to a new Worksheet

  1. #1
    Registered User
    Join Date
    10-19-2008
    Location
    Canada
    Posts
    1

    Moving Data to a new Worksheet

    With the use of Excel VBA and/or macro’s, how do you take data from a selected cell or row on one worksheet and move that data or row data to specified locations on another worksheet in the same workbook?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Macros & VBA re not different, macros are created using VBA.

    This question is cvered extensively ib many questions on the Forum. Take a look at the Contacts form herehttp://www.excel-it.com/vba_examples.htm
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Valued Forum Contributor
    Join Date
    09-19-2008
    Location
    It varies ...
    MS-Off Ver
    Office365 - 64bit
    Posts
    862
    As Roy says, you should check the examples as this will give you a good feel for the referencing conventions; however, I thought a quick summary might also help and give context to the examples. As you probably know, the basic structure for a copy/paste is:
    Please Login or Register  to view this content.
    If you ran the above code from the workbook object, it would copy cell A1 to cell B2 in the active sheet. If you ran it within a worksheet object, it would copy and paste the same cells in that worksheet, regardless of which sheet was active at the time.

    In order to explicitly specify the from sheet / to sheet you just need to specify the worksheet/s in the statement such as:
    Please Login or Register  to view this content.
    In this case, the worksheets are explicit, so it doesn't matter which is active or which object you're running the code from. This can be a little confusing if you're not familiar with the object heirarchy, but basically: if you do not specify a sheet, excel assumes you mean the active sheet if the code is running in the workbook object, or - if the code is running within a worksheet rather than in the workbook object - then excel assumes you mean that worksheet (rather than the activesheet). Of course, if you use only an explicit worksheet reference for (say) the paste destination, then the same heirarchy rules apply for the copy range. Hope that helps. MM.
    MatrixMan.
    --------------------------------------
    If this - or any - reply helps you, remember to say thanks by clicking on *Add Reputation.
    If your issue is now resolved, remember to mark as solved - click Thread Tools at top right of thread.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    Or you don't need to copy
    Please Login or Register  to view this content.

+ 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. Using a cell on another worksheet as input for data validation
    By gessie in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-14-2008, 09:53 AM
  2. Copying data worksheet to worksheet
    By fallito in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-24-2008, 11:40 PM
  3. copy data to new worksheet
    By pentrix2 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-01-2008, 12:43 PM
  4. Copying Data from 1 Worksheet to another Worksheet (Accumulative data)
    By sharonbl in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-28-2007, 08:40 PM
  5. Help! Vba Copy Cell To Different Worksheet.
    By Dabooj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-03-2006, 05:53 AM

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