Results 1 to 14 of 14

Store visble databodyrange in filtered table into an array

Threaded View

  1. #12
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Store visble databodyrange in filtered table into an array

    Hi Yasser,

    Thanks for the rep!

    This seems to work:

    Sub CopyTableII(): Dim WT, n As Long, c As Long, s As Long
    Dim R As Range, UR As Range: Set UR = ActiveSheet.UsedRange
    WT = Cells(20, 2).Resize(UR.Rows.count, UR.Columns.count)
                        s = 1: n = 1
    For Each R In UR.SpecialCells(xlCellTypeVisible)
                WT(s, n) = R.Value: n = n + 1
        If n = UR.Columns.count + 1 Then s = s + 1: n = 1
     Next
    Cells(20, 2).Resize(s, UR.Columns.count) = WT
    End Sub
    Last edited by xladept; 04-15-2018 at 12:08 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Pivot Table DataBodyRange for a dynamic range selection in Cell Formula
    By SMCC in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2018, 01:57 PM
  2. [SOLVED] Excel Table: find sum of databodyrange
    By snapfade in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-08-2017, 07:20 PM
  3. [SOLVED] Dynamic Changing Data, Based on Criteria Store in Array, Sum array and store in Cell
    By penbeacho in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-28-2015, 10:31 AM
  4. Can I store an array of data within a table?
    By krabine in forum Access Tables & Databases
    Replies: 3
    Last Post: 01-14-2015, 12:04 PM
  5. Copy table DataBodyRange to another table Loop
    By jockywilson in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-19-2014, 11:38 AM
  6. Replies: 25
    Last Post: 01-24-2013, 06:07 AM
  7. [SOLVED] Count nullstrings in pivot table (databodyrange)
    By jonasmj in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2005, 10:06 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