+ Reply to Thread
Results 1 to 2 of 2

Macro to search through table and copy all rows with data into another table

  1. #1
    Registered User
    Join Date
    09-09-2020
    Location
    Ohio, USA
    MS-Off Ver
    Version 1908
    Posts
    35

    Macro to search through table and copy all rows with data into another table

    I have a table (table4 on sheet1) that has a bunch of blank rows in it. Due to the rows getting filtered constantly, I can't just hide them as they will reappear every time I press show all. How do I go through a table ranging from A12-Vxxxx and copy every row with visible data into a table on a new sheet (sheet 2)?

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,947

    Re: Macro to search through table and copy all rows with data into another table

    I have no idea what version 1908 means - If you are using 365, take a look at the FILTER function; otherwise, you can create a column of row index formulas like so, entered into cell A1 of the other sheet using Ctrl-Shift-Enter:

    =IFERROR(SMALL(IF(Sheet1!$A$1:$A$1000<>"",ROW(Sheet1!$A$1:$A$1000)),ROW()),"")

    Copy that down until it returns blanks, and then use INDEX formulas like this in cell B1:

    =INDEX(Sheet1!$A$Z,$A1,COLUMN(A1))

    Copied down and across to complete the data extract.
    Bernie Deitrick
    Excel MVP 2000-2010

+ 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. Help with table - Copy rows, delete rows, reset table & copy table
    By gkpbydesign in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-15-2019, 10:30 AM
  2. Macro to fill 1st table with info from 2nd table. 2nd table search with 2 conditions
    By Ribeiro.JD in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-17-2016, 02:03 PM
  3. Macro to copy rows of data in a table which contains a string and change cell value
    By teresadg in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-29-2015, 11:02 PM
  4. macro to copy table from sheet1 to sheet2 (# of rows in table may vary everytime)
    By arkharova.s in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-18-2014, 03:18 AM
  5. Macro to Copy Pivot Table and Paste a Regular Data Table in the Same Position
    By webfeet2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2013, 06:34 AM
  6. [SOLVED] Macro to copy data from tables with unspecified rows on multiple sheets into one table
    By sara ghaith in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2012, 08:31 AM
  7. Macro that finds word in table and reports all rows with data to new table
    By jermsalerms in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-05-2007, 03:57 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