+ Reply to Thread
Results 1 to 6 of 6

Copying filtered data from 1 sheet to another

  1. #1
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    209

    Copying filtered data from 1 sheet to another

    I have data in sheets("Data") that i want to search fro specific terms on sheet2 then once the data has been filtered copy the result to be displayed on sheet2

    i am currently using this code that seems to select the row 3 on sheet2 not going through the data on sheets("Data")

    I have attached a couple of screen shots

    Please Login or Register  to view this content.
    Thank you for any help much appreciated
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Copying filtered data from 1 sheet to another

    Hello UltimateNeo,

    A quick glance shows me a couple of issues with the posted code.

    The first one that may explain some of the behaviour is the paste command. Finding the last used row works well but only the first time in a loop, it seems the values only get actually recalculated after a save function at a minimum so the Range B1000 etc will always return the same value of 14 and add the offset to paste into row 15.

    The second issue I see is that the copy commands seem to be copying the cells in the Sheet2 tab and not the Data tab you think they are. haven't worked that one out yet as I am not a big "Range" and "With" person, generally taking the long way out

    I did have to slightly restructure your If Else If commands so they made more sense to me.

    I note that you have no code currently to deal with the input fields from Sheet2 being all blank (and having the blue background on all cells with no indication of input cells is a bit confusing initially) - obviously I hit that error condition straight up )

    version with some changes attached

    just some rapid thoughts
    Attached Files Attached Files
    Last edited by jmac1947; 04-05-2019 at 12:13 AM. Reason: minor typo

    Cheers

    Jmac1947

    1. Please consider clicking on the * Add Reputation if you think this post has helped you
    2. Mark your thread as SOLVED when question is resolved

  3. #3
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Copying filtered data from 1 sheet to another

    Hello again,

    I have had a few more goes and managed, by only considering "JobNo", to get it "sort of" working.

    I take no real pride in the sloppy code except that it appears to work, my only defence

    There is still a fair bit of work needed to work out the code for other search options AND to consider what is the desired outcome if multiple search terms are entered.

    Hope this gives you some direction, am Ok to continue if you need more assistance but in the meantime OTY
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    209

    Re: Copying filtered data from 1 sheet to another

    I am just working with your code but seems to be working ok .

    The JobNo search would be a exact 1 match result returned.

    The LastName would be a like function to bring up multiple results fro people with same lastname and the like to catch for spelling mistakes.

    Contact No would be a single result match unless same customer bought in anther or the same item again.

    Model would show all results of same model

    DateIn would show all records that matched that date. All search terms would be individual you wouldn't need to put 2 or more search criteria together

    Thank you for your help.

  5. #5
    Valued Forum Contributor
    Join Date
    01-19-2010
    Location
    Melbourne Australia
    MS-Off Ver
    latest is Excel 2016. have older versions
    Posts
    624

    Re: Copying filtered data from 1 sheet to another

    You are welcome,

    It did occur to me that an alternative solution might be to filter the Data sheet and then work with the visible rows after the filter (s) have been applied.

    If you are indeed only going to process one of the inputs then apart from handling the "none at all" you would need to ensure the expectations of the "correct result" are clear if an operator entered multiple search inputs.

    Users will always do what you least expect them to do, despite any instructions to the contrary

    Thanks for the rep, appreciated
    Last edited by jmac1947; 04-05-2019 at 01:32 AM. Reason: adding in thanks

  6. #6
    Forum Contributor
    Join Date
    01-06-2019
    Location
    Australia
    MS-Off Ver
    2019
    Posts
    209

    Re: Copying filtered data from 1 sheet to another

    Yeah will have to re think it a little. Thanks for your help

+ 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 exact position in sheet that have filtered data
    By denis2201 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 06-06-2016, 06:50 AM
  2. copying filtered data from one sheet to another automatically
    By hnnn in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-14-2010, 10:36 AM
  3. link to copying data(filtered) into another sheet using macro
    By sameerk0286 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-10-2010, 09:32 PM
  4. Copying "filtered" data to another sheet
    By aussie89 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-27-2010, 09:45 AM
  5. Copying filtered rows from one sheet to another
    By Jenda in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-29-2010, 08:51 PM
  6. Copying & pasting on Filtered sheet
    By Shadmani in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 07-09-2009, 01:42 PM
  7. [SOLVED] Trasnsposing or copying filtered data from one sheet to another
    By Sierras in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-14-2006, 01: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