+ Reply to Thread
Results 1 to 3 of 3

If value is in array then copy row to another sheet

  1. #1
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    If value is in array then copy row to another sheet

    Hi all

    I am very new to arrays and wanting to use a better way to search a sheet for a value and copy the rows to a new sheet.

    I currently have this code which works well but considering the sheet it is looking in as a lot of data, it takes far too long

    Please Login or Register  to view this content.
    What i am wanting it to look for a specific value (EMP_REF), and copy all rows to another sheet.
    Any suggestions on how to make the data it is searching into an array?

    Any help is much appreciated!

  2. #2
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,648

    Re: If value is in array then copy row to another sheet

    No need to loop through the cells to check for specific value, just use Autofilter to filter in the rows where column A has the desired value and then copy the visible rows to the desired sheet in one go.

    Or Advanced filter is also a good option if you set a criteria range and that would be the fastest method to copy the data to another location.
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  3. #3
    Forum Contributor
    Join Date
    06-24-2013
    Location
    New Zealand
    MS-Off Ver
    Excel 2016
    Posts
    124

    Re: If value is in array then copy row to another sheet

    I have figured out how to add the sheet to an array and search it, but i want to be able to add the found row in the array to another array....

    Here is what I have so far, but the parts commented out is where i am struggling.


    Please Login or Register  to view this content.
    Would really appreciate help with this

+ 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. [SOLVED] Copy sheet into 3D array
    By spencer_time in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 10-11-2019, 12:42 PM
  2. [SOLVED] VBA copy specified columns from one sheet to another using array
    By Tunesmith in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-31-2019, 11:59 AM
  3. copy from sheet to array
    By twozedz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-14-2016, 06:57 AM
  4. How to copy an array to excel sheet?
    By helpmeimlost in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-07-2014, 02:24 AM
  5. Replies: 0
    Last Post: 06-28-2014, 02:26 PM
  6. Copy value to Array variables use them in another sheet!
    By ravikiran in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-19-2012, 04:15 AM
  7. Copy from one sheet using an array
    By peakymatt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2009, 09:23 AM

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