+ Reply to Thread
Results 1 to 6 of 6

Copying value on row to another sheet when specific criteria met within a column

  1. #1
    Registered User
    Join Date
    12-21-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    28

    Copying value on row to another sheet when specific criteria met within a column

    Hi Everyone!

    So in this instance I want to copy data to another sheet when a spesific criteria is met.

    I attached an example and a desired output which in this instance is the sheets called "1" "2" and "3"

    I have all my data on the sheet called "Input" but I want to extract some data from this sheet.

    So for one example, when the value in column L is =>0.8 but <1.5 I want it to copy the data in column V on the "input" sheet to sheet "1" and input it into Column A

    The Data must be taken as a value of the data shown on the "input" sheet as it is a formula and will not function on sheet "1" without the related data and is only required as a value

    Sheet "1" doesn't require any Headers as I am going to export these after as a csv

    Like wise I would then repeat this for other values, which in my attached example are

    between 1.5 and 2.5 results in data being moved to Sheet "2"
    between 2.5 and 3.5 results in data being moved to Sheet "3"

    I also wanted to avoid using the clipboard as this would be repeated for a range of values and I feel it would be more stable without.

    Any help would be greatly appreciated.

    Thanks

  2. #2
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Copying value on row to another sheet when specific criteria met within a column

    You can do this really neatly, using Power Query.

    Change your Source Data (on sheet 'Input') to a Table, then use that table as the source of a Power Query, which loads to your output worksheet.

    The query looks like:
    Please Login or Register  to view this content.
    Repeat with the relevant filter values for the other output sheets.

    Now you can simply click "Refresh All" and your three output sheets will automatically update, with the values from Column V, subject to the filter criteria you have specified.

    It's neat, as it needs no macros / code, it uses no complex formulae, and it doesn't do any copying / pasting. As long as you keep your source data in a Table, then the source range is automatically dynamic.

    See attached workbook for a worked example.
    Attached Files Attached Files
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

  3. #3
    Registered User
    Join Date
    12-21-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    28

    Re: Copying value on row to another sheet when specific criteria met within a column

    Hi Olly

    Thank you for your response!

    I can see that is a brilliant solution and I understand it is very clean to do without macros. I understand your approach here.

    The only issue is I need this operation as part of a larger macro and need to be able to create the sheets to output to then delete them after they are exported to seperate CSV sheets all in one button. I can do all the other bits in a macro but it is just the bit in question I am struggling with.

    so although your suggestion is a cleaner approach, I do need a macro approach to the solution other wise I would be extremely happy with your proposed solution.

    Do you have a macro based solution to this issue?

    Thanks again for your help

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copying value on row to another sheet when specific criteria met within a column

    Maybe:

    Please Login or Register  to view this content.
    Last edited by JOHN H. DAVIS; 05-17-2017 at 02:24 PM.

  5. #5
    Registered User
    Join Date
    12-21-2013
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    28

    Re: Copying value on row to another sheet when specific criteria met within a column

    Hi John

    Thanks for this!

    I can see it works perfectly on the test data sheet and will give it a shot on my actual data set to see how it works.

    This is extremely useful to know for the future.

    Thank you again John and thank you Olly for the time you have spent on this, It is greatly appreciated.

    If all is well I will mark the thread as solved tomorrow.

    Thanks again

    ---Further to the above---

    I have now tested this on my own data set and integrated it into the macro I was wanting and it works perfectly. So this is definitely the solution.

    I will now mark the thread as solved.
    Last edited by sam103329; 05-19-2017 at 07:27 AM. Reason: Update to status.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Copying value on row to another sheet when specific criteria met within a column

    You're welcome. Glad to help out and thanks for the feedback and the reps.

+ 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. Replies: 7
    Last Post: 09-30-2014, 01:44 PM
  2. [SOLVED] Copying row of data to new sheet if specific value exists in column
    By raz333 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-17-2013, 04:33 PM
  3. [Solved] Copying Cells from one sheet to another based on specific criteria
    By james.heston in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-30-2013, 09:51 AM
  4. [SOLVED] copying specific certain column data based on cell/column value to another sheet
    By arctic7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-09-2012, 03:38 PM
  5. Replies: 4
    Last Post: 08-29-2012, 10:32 AM
  6. Replies: 6
    Last Post: 06-27-2012, 04:38 PM
  7. Copying rows from another sheet based on specific criteria
    By jamesbrown008 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-06-2011, 01:53 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