+ Reply to Thread
Results 1 to 2 of 2

Visible Cells Only, Autofilter

  1. #1
    Registered User
    Join Date
    12-13-2020
    Location
    Portland, Oregon
    MS-Off Ver
    O365
    Posts
    4

    Exclamation Visible Cells Only, Autofilter

    Hello, simple problem, but apparently very difficult to solve gracefully.

    1. I have an excel worksheet with several rows of data (records)
    2. I've enabled autofilter in VBA and filtering out rows based on filter criteria
    3. I'm trying to capture a value in column H for a visible cell only. E.g., when the filter is applied, all rows but 1 go away, that 1 row, I need the value that is in the remaining visible column H
    4. my plan is to use range("h500").end(xlup).select (total row data is 400 rows long)
    5. problem is, the code works, but xlups to the last row in the record (row 400) even through the row is autofiltered. (no visible)

    I've searched the web, lots of examples, but they all seem to complicated. I've played around with special cells (xlcelltypevisible), but no luck there.

    Appreciate the support.

    Thx

  2. #2
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Visible Cells Only, Autofilter

    You'd be far better off adding a column to your data. If your data were in A1:X1000,

    Y2:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Fill Y2 down into Y3:Y1000.

    If there were only one visible row, the col Y value in that row would be 1, and all other col Y values would be 0.

    Alternatively, if the values you want are numeric, consider using Application.WorksheetFunction.Aggregate. The sum of a single visible cell would be that single cell's value.

+ 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. SUBTOTAL/SUMIF on autofilter visible cells only
    By crispben in forum Excel General
    Replies: 9
    Last Post: 10-23-2017, 08:39 PM
  2. selecting visible cells after autofilter without headlines
    By Mac86 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-21-2016, 08:52 PM
  3. Copying Visible Cells from Autofilter with/out headings
    By Eijaz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-09-2014, 06:12 AM
  4. When using Autofilter with SumIf, can not get it to sum only visible cells.
    By DitoPower in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-12-2013, 07:36 AM
  5. [SOLVED] Copy/Pasting Values from visible cells (using autofilter) to visible cells
    By evakotsi in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-23-2012, 07:49 AM
  6. Rank visible cells with autofilter
    By tolio in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-16-2008, 10:16 AM
  7. Autofilter - Sum visible cells
    By BVHis in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2008, 06:01 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