+ Reply to Thread
Results 1 to 6 of 6

Only selecting visible cells in a table with hidden rows

  1. #1
    Registered User
    Join Date
    03-11-2014
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    9

    Only selecting visible cells in a table with hidden rows

    I have a table that I filter so their are rows that are hidden. I then select a column (email list) using the code below. I am trying to figure out how to return only the visible cells in the column.

    I am just stuck on this. Thanks in advance.

    Joe

    Please Login or Register  to view this content.
    Last edited by pfeifferjoey; 04-30-2014 at 08:51 PM.

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

    Re: Only selecting visible cells in a table with hidden rows

    I would do it this way - assuming you have declared your variables elsewhere, you need to add
    Dim c As Range - and you could add error checking to make sure that only a single column or row is selected...

    Please Login or Register  to view this content.
    Last edited by Bernie Deitrick; 04-30-2014 at 10:45 AM.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    03-11-2014
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Only selecting visible cells in a table with hidden rows

    This works perfectly!! Thanks for the help!

  4. #4
    Registered User
    Join Date
    03-11-2014
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    9

    Question Re: Only selecting visible cells in a table with hidden rows

    Hi Bernie,

    The code is working great except for when I only select the last cell in my filtered table. It sends the For Loop into an infinite loop.

    Please Login or Register  to view this content.

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

    Re: Only selecting visible cells in a table with hidden rows

    Try
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-11-2014
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    9

    Re: Only selecting visible cells in a table with hidden rows

    Excellent!! Thanks Bernie!

+ 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] Format all cells in all sheets to Protection Hidden on visible and hidden tabs
    By DeRo22 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-28-2014, 03:17 PM
  2. Table Object after filtering - Count visible rows & First visible row
    By limalf in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-13-2013, 07:29 PM
  3. Use visible rows from autofilter to build Pivot table. Or use visible rows to Copy/Paste
    By mwhitedesigns in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2012, 10:34 AM
  4. selecting visible rows
    By sexgod in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 04-14-2007, 04:26 PM
  5. How do I calculate only visible data (not hidden rows)?
    By Peter in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-18-2006, 12:40 PM

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