+ Reply to Thread
Results 1 to 7 of 7

Copying data between different worksheets

  1. #1
    Registered User
    Join Date
    10-07-2014
    Location
    Salvador da Bahia, Brazil
    MS-Off Ver
    2013
    Posts
    39

    Copying data between different worksheets

    Hey guys.

    I've been trying to find a way of copying data from specific cells in one worksheet (named 'Workflow') to another worksheet (named 'Active Projects') if a condition is met. I tried to use a formula inside the cells where the data would be pasted into. The array formula was placed in the 'Active Projects' worksheet range from A24 through to D74 (the actuall one cell that contained the formula was A24). The array formula was:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    However, it left me with two problems:
    1. Entries in cells in 'Active Projects' sheet sets the ranges for a chart, ending in chart having many gaps due to presence of formula in cells;
    2. The range of the chart is limited to the cells that contain the formula and meets its IF logical test condition, hence whatever falls off both ranges does't appear in the chart;

    So I thought that maybe a VBA code would easily do the trick and solve both these problems in one go?

    Attachment 403719

    I'd appreciate if any of you guys could help me with that.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copying data between different worksheets

    So you're looking for a macro to update the table on Active Projects starting at row 24 to list all the projects from Workflow with a status of "O" in column R? That can be done with a simple AUTOFILTER and COPY.

    1) Copy A:D to A:D, easy enough
    2) Fill in formulas in F:H
    3) Where are the percentages in column E coming from?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    10-07-2014
    Location
    Salvador da Bahia, Brazil
    MS-Off Ver
    2013
    Posts
    39

    Re: Copying data between different worksheets

    Hi JBeaucaire. Thanks for the reply. You made my question sound so much clearer! lol

    What is AUTOFILER? A formula? Inside the cell? (I'm afraid I'm not that experienced with Excel).

    Percentages in column E comes from a manual input. I have individual workbooks for each project and this one is a more-then-necessary summary. I might link all of them at some point but right now I'm avoiding external links because it sounds a bit annoying.

  4. #4
    Forum Expert skywriter's Avatar
    Join Date
    06-09-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    2,760

    Re: Copying data between different worksheets

    What is AUTOFILER?
    AUTOFILTER is a way to filter your spreadsheet with code.

    He's going to write you some code that will filter your sheet and copy the results of the filter.
    Click the * Add Reputation button in the lower left hand corner of this post to say thanks.

    Don't forget to mark this thread SOLVED by going to the "Thread Tools" drop down list above your first post and choosing solved.

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copying data between different worksheets

    I would think a macro that is designed to recreate the source table below for your chart would need the ability to create ALL the columns. So the method for ascertaining the column E values needs to exist as well.

  6. #6
    Registered User
    Join Date
    10-07-2014
    Location
    Salvador da Bahia, Brazil
    MS-Off Ver
    2013
    Posts
    39

    Re: Copying data between different worksheets

    Hi guys. Thanks for your replies.
    skywriter good to hear from you again.

    I guess I misunderstood what JBeaucaire first said. That was autofilTer not autofiLer. Sorry.

    So I spent the last couple of days trying to figure out how to copy and paste data from 'Workflow' sheet to 'Active Projects' sheet using OFFSET. Since I wasn't very successfull in understanding a thing about this function , I kind of kept the previous formula but stretched the IF condition:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    As you guys said an autofilter would do the trick, I expanded the chart's data source selection from A24:D74 to A24:D500. Then, I filtered the column A leaving blank cells out. BAM! Looks very good now. Chart is limited to 477 rows maximum but I do not intend to run such a hidious amount of projects at the same time anyway!

    The only thing is that I have to hit Ctrl+Alt+L in both 'Workflow' and 'Active Projects' sheets in order to sort all data and update the chart. Is there a (simple) way for autofilter to automatically update the sorting as data is pasted into the cells in 'Active Projects' sheet?

    Cheers mates!
    Last edited by adriano.r.marques; 06-27-2015 at 07:07 PM.

  7. #7
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copying data between different worksheets

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook
    By JRayhan in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-14-2013, 03:56 PM
  2. Copying Data from WorkSheets and Pasting them to a different Worksheets/Workbook
    By JRayhan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-06-2013, 11:22 AM
  3. Replies: 1
    Last Post: 11-22-2011, 02:36 PM
  4. Copying data between two worksheets
    By bengrah in forum Excel General
    Replies: 1
    Last Post: 07-16-2010, 07:23 AM
  5. Copying data across different worksheets
    By Nic M in forum Excel General
    Replies: 4
    Last Post: 05-08-2006, 04:30 PM

Tags for this Thread

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