+ Reply to Thread
Results 1 to 5 of 5

Copy cells/range from worksheets positioned between two worksheets

  1. #1
    Registered User
    Join Date
    07-07-2014
    Location
    Los Angele, CA
    MS-Off Ver
    2010
    Posts
    3

    Copy cells/range from worksheets positioned between two worksheets

    Hi,

    Let's say I have a workbook with 7 worksheets named, for example, "Instruction", "Begin", "Worksheet 1", "Worksheet 2", "Worksheet 3", "End", and "Data". (in that order)

    What I want to do is run a macro to go to whatever worksheet that is in between "Begin" and "End" and copy, for example, cells $C$1:$D$10; then paste as formula into worksheet "Data" starting from cell C1 and then down a list (i.e., copied cells from "Worksheet 1" get pasted as formula into "Data" cells C1:D10; then copied cells from "Worksheet 2" get pasted as formula into "Data" cells C11:D20, and so on and so forth).

    But if I were to add more worksheets (e.g., "Recipe" and "ToDo") positioned in between "Begin" and "End" and run the macro again, it'll either 1) re-copy all the formulas from the included worksheets back into "Data" including the formulas from the newly added/placed worksheets or 2) it'll add the formulas from the newly added/placed worksheets and paste into "Data" at the end of the list.

    Hopefully whoever replies, can create the macro to run based on the position of worksheet, and not based on the name of worksheet, since ultimately there will probably be over 10 worksheets between "Begin" and "End".
    Last edited by ucladidas; 07-08-2014 at 12:11 PM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Copy cells/range from worksheets positioned between two worksheets

    Hi,
    try the following
    Please Login or Register  to view this content.
    PS. I'm not sure if pasting as formulas is indeen the best option - but of course it depends on your data.
    Best Regards,

    Kaper

  3. #3
    Registered User
    Join Date
    07-07-2014
    Location
    Los Angele, CA
    MS-Off Ver
    2010
    Posts
    3

    Re: Copy cells/range from worksheets positioned between two worksheets

    Thank you! This is great!

    I actually misspoke on what I wanted "pasted" into "Data" worksheet. Instead of pasting, I actually wanted cell references from "Data" to the worksheets in between "Begin" and "End". (I've attached a sample of what I mean.)

    Testing.xlsx

    Essentially, in "Data" cell C1, would be formula "=WorkSheet1!C1", and the relative formulas carried over to columns E and F and down to row 10; then in "Data" cell C11, would be formula "=WorkSheet2!C1", and again the relative formulas carried over and down.

    Thanks again for your help!

  4. #4
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,623

    Re: Copy cells/range from worksheets positioned between two worksheets

    Honestly - I'd not go this way (creating references to other sheets), but of course I am not aware of the whole picture, so :

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    07-07-2014
    Location
    Los Angele, CA
    MS-Off Ver
    2010
    Posts
    3

    Re: Copy cells/range from worksheets positioned between two worksheets

    Thank you so much! This has worked out perfectly!

+ 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. Copy a range of cells without switching worksheets.
    By dbs105 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2013, 05:55 AM
  2. Copy/Paste Range of Data from Multiple Workbooks/Worksheets to Master Workbook/Worksheets
    By NumberCruncher311 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-19-2013, 08:21 PM
  3. [SOLVED] Copy to this range of cells in multiple worksheets?
    By ThomasCarter in forum Excel General
    Replies: 2
    Last Post: 10-02-2012, 01:56 PM
  4. Copy selected cells from a range of worksheets and paste in master table
    By simba3088 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-20-2012, 07:59 AM
  5. [SOLVED] Copy and paste cells dynamically to a range in a series of named Worksheets.
    By skyping in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-27-2012, 04:22 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