Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Count Property

I have included the following For Next statement in my
code, using the Count Property. The purpose is to
determine the first visible row in an auto filtered list.
There's more VBA within the Sub but when I step through at
For i = 1 to cells(Rows.Count, 1).End (xlUp), VBA exits
from my code. Is it because I have not applied the Count
property to a Range Object. If so, how do I rewrite? Can
anyone kindly help?

Many thanks
Jacqui


For i = 1 To Cells(Rows.Count, 1).End(xlUp)
If Rows(i).EntireRow.Hidden = False Then
iStartRow = i
Exit For
End If
Next

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Count Property

Looks like you want to put .Row at the end

For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"jacqui" wrote in message
...
I have included the following For Next statement in my
code, using the Count Property. The purpose is to
determine the first visible row in an auto filtered list.
There's more VBA within the Sub but when I step through at
For i = 1 to cells(Rows.Count, 1).End (xlUp), VBA exits
from my code. Is it because I have not applied the Count
property to a Range Object. If so, how do I rewrite? Can
anyone kindly help?

Many thanks
Jacqui


For i = 1 To Cells(Rows.Count, 1).End(xlUp)
If Rows(i).EntireRow.Hidden = False Then
iStartRow = i
Exit For
End If
Next



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Count Property

Jacqui,

The problenm is that you have a range object, and you need a long/.integer.

Try

For i = 1 To Cells(Rows.Count, 1).End(xlUp).Row
If Rows(i).EntireRow.Hidden = False Then
iStartRow = i
Exit For
End If
Next


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"jacqui" wrote in message
...
I have included the following For Next statement in my
code, using the Count Property. The purpose is to
determine the first visible row in an auto filtered list.
There's more VBA within the Sub but when I step through at
For i = 1 to cells(Rows.Count, 1).End (xlUp), VBA exits
from my code. Is it because I have not applied the Count
property to a Range Object. If so, how do I rewrite? Can
anyone kindly help?

Many thanks
Jacqui


For i = 1 To Cells(Rows.Count, 1).End(xlUp)
If Rows(i).EntireRow.Hidden = False Then
iStartRow = i
Exit For
End If
Next



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
Row Height property CY Excel Discussion (Misc queries) 1 September 21st 07 05:50 AM
xls property 71marco71[_12_] Excel Programming 1 February 13th 04 01:02 AM
Property Set Bob Phillips[_6_] Excel Programming 0 February 4th 04 09:24 PM
AsktoUpdateLinks Property Mike B[_5_] Excel Programming 1 January 20th 04 04:07 PM
Width property jim c. Excel Programming 1 September 21st 03 11:03 PM


All times are GMT +1. The time now is 06:54 AM.

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

About Us

"It's about Microsoft Excel"