+ Reply to Thread
Results 1 to 4 of 4

Counting Visible rows is not working

Hybrid View

abduljaleel.mca Counting Visible rows is not... 08-01-2013, 08:04 AM
Norie Re: Counting Visible rows is... 08-01-2013, 08:19 AM
Debraj Roy Re: Counting Visible rows is... 08-01-2013, 08:26 AM
abduljaleel.mca Re: Counting Visible rows is... 08-01-2013, 10:15 AM
  1. #1
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Counting Visible rows is not working

    Hi,

    I am working on a project based on Drop down box and using the below code

    nStart = 5
    nEndRw = Cells(Rows.Count, "F").End(xlUp).Row
    Rows(nStart & ":" & nEndRw).Hidden = True
    
    Dim ddBox5 As DropDown
    Set ddBox5 = Sheets("TOC").DropDowns("Drop Down 5")
    Set rngList = Sheets("Sheet1").Range(ddBox5.ListFillRange)
    Set ddValue = rngList(ddBox5.Value)
    
    If d6Value = "All" Then
    Worksheets("TOC").Rows("1:91").Hidden = False
    Range("A1").Select
    End If
    
    LastRow = Sheets("TOC").SpecialCells(xlCellTypeVisible).Rows.Count
    
    MsgBox LastRow
    However the below line shows error (object does not support this property or method)

    LastRow = Sheets("TOC").SpecialCells(xlCellTypeVisible).Rows.Count
    Kindly help to execute this

    Thanks
    Abdul

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Counting Visible rows is not working

    Abdul

    SpecialCells applies to a range, not a worksheet.

    For example to find visible cells in column A.
    Sheets("TOC").Columns(1).SpecialCells(xlCellTypeVisible).Rows.Count
    If posting code please use code tags, see here.

  3. #3
    Forum Expert Debraj Roy's Avatar
    Join Date
    09-27-2012
    Location
    New Delhi,India
    MS-Off Ver
    Excel 2013
    Posts
    1,469

    Re: Counting Visible rows is not working

    Try this...

    lastrow = Sheets("TOC").range("A" & rows.Count).end(xlup).row
    will work on filter also..
    Regards!
    =DEC2HEX(3563)

    If you like someone's answer, click the star to give them a reputation point for that answer...

  4. #4
    Valued Forum Contributor abduljaleel.mca's Avatar
    Join Date
    02-13-2013
    Location
    Chennai, India
    MS-Off Ver
    MS 365 Business
    Posts
    326

    Re: Counting Visible rows is not working

    Thanks Norie.
    I know only 10% of VBA when I was started to work on it but now I learned and learning many things through this forum.

    Thank you guys

+ 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. counting visible rows only
    By Catalpa in forum Excel General
    Replies: 10
    Last Post: 01-10-2013, 09:38 AM
  2. 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
  3. [SOLVED] Counting Visible Rows
    By jomili in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 02-09-2012, 11:17 AM
  4. counting only the visible rows
    By ashish727 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-05-2008, 09:06 AM
  5. Counting Only Visible Rows
    By Dom2012 in forum Excel General
    Replies: 5
    Last Post: 11-22-2006, 01:19 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