Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 25th, 2005, 05:47 PM
Registered User
 
Join Date: Mar 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Skipping hidden rows in a data list

Hi,

I have a user form which acts as a DB front end for a spreadsheet and I want it to skip any rows hidden by AutoFilter. I constructed the following code based on chapter 9 in "Excel 2003 VBA Programmer's reference" . The code loops through the next rows in the range and tests if they are hidden.
Unfortunately, it doesn't work as expected and seems to skip rows that aren't hidden and show ones that are.

Private Sub cmdNextRecord_Click()
Dim i As Integer
i = 1
    With Range("Database")
        Do While RangeData.Rows(Navigator.Value + i).EntireRow.Hidden = True
        i = i + 1
        Loop
        If RangeData.Row < .Rows(.Rows.Count).Row Then
            'Load next record only if not on last record
            Navigator.Value = Navigator.Value + i
        End If
    End With
End Sub

Regards
JT







Similar Threads
Thread Thread Starter Forum Replies Last Post
skipping sunday when adding data Vince_421 Access VBA 2 March 6th, 2007 11:22 AM
alternative rows in diff. colours for list view madhukp VB How-To 2 October 7th, 2004 07:12 AM
Accessing hidden column data badgolfer HTML Code Clinic 0 July 28th, 2004 07:14 AM
limit rows returned in a list box stoneman Access 1 January 16th, 2004 10:46 PM
Hidden items in list boxes dbkester Access VBA 2 August 28th, 2003 03:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.