+ Reply to Thread
Results 1 to 2 of 2

Autofilter data and put the numbers of visible rows into an array

  1. #1
    Registered User
    Join Date
    12-18-2011
    Location
    Spring Grove, IL
    MS-Off Ver
    Excel 2010
    Posts
    1

    Autofilter data and put the numbers of visible rows into an array

    I have not used arrays yet in VBA. However, I think using an array will be fast then the loop I am using now to determine the row number of the next visible row of autofiltered data.

    For example: I filter a set of data on specified fields and the results show the following rows as visible:
    2
    4
    6
    7
    10

    How to I get 2,4,6,7,10 into an array that I can loop through instead of looping for visible rows only.

    The followng is what I currently have for code without using an array:

    ActiveCell.Offset(1, 0).Select
    Do Until ActiveCell.EntireRow.Hidden = False
    ActiveCell.Offset(1, 0).Select
    Loop
    nrow = ActiveCell.Row
    intAddress = nrow

  2. #2
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Re: Autofilter data and put the numbers of visible rows into an array

    Hello Duchessix and welcome to the forum.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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