Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default Data List Visible Rows

Without taking anything away of the esteemed authors of that fine book, this
is how I'd iterate through a database skipping hidden rows:

Dim Rw As Range
For Each Rw In Range("Database").SpecialCells(xlCellTypeVisible). Rows
Debug.Print Rw.Row
Next


--
Jim Rech
Excel MVP
"JT3686" wrote in message
...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
List Visible Data Jakobshavn Isbrae Excel Worksheet Functions 3 March 3rd 08 07:24 PM
Printing only Rows with Visible Data Storm Excel Discussion (Misc queries) 7 December 8th 05 09:19 PM
How to plot only visible autofiltered rows in a data list Craig Charts and Charting in Excel 1 June 28th 05 08:38 PM
Copy visible rows with data to new file slc[_13_] Excel Programming 0 September 23rd 04 07:03 AM
List Box Visible Rows Only John Wilson Excel Programming 5 October 28th 03 07:50 PM


All times are GMT +1. The time now is 09:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"