Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9075895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T18:58:46+00:00 2026-06-16T18:58:46+00:00

I am hiding the rows by using following lines of code excluding top two

  • 0

I am hiding the rows by using following lines of code excluding top two rows only because they are Headers.

For i=3 To ThisWorkBook.Sheets("ALL").Range("A1",ThisWorkBook.Sheets("ALL").Range("A65536").End(xlUp)).Rows.Count
    ThisWorkBook.Sheets("ALL").Rows(i).EntireRow.Hidden=True
Next

Now to get the hidden rows count i am using following lines of code

From i=3 To ThisWorkBook.Sheets("ALL").Range("A1",ThisWorkBook.Sheets("ALL").Range("A65536").End(xlUp)).Rows.Count
    ThisWorkbook.Sheets("ALL").EntireRow.Hidden=False
Next

But I am getting rowcount as 2. Infact the sheet has 10 rows. So how to make hidden rows as visible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T18:58:47+00:00Added an answer on June 16, 2026 at 6:58 pm

    If I understand your question correctly, here is an alternative way to approach your problem that will give you some code that runs faster and is a pretty clean to manage:

    Option Explicit
    
    Sub CountHiddenRows()
    
    Dim wks As Worksheet
    Set wks = ThisWorkbook.Sheets("ALL")
    
    With wks
    
        Dim lngLastRow As Long
        lngLastRow = .Range("A" & .Rows.Count).End(xlUp).Row
    
        .Range("A3:A" * lngLastRow).EntireRow.Hidden = True
    
        Dim rngConsider As Range
        Dim lngHiddenRows As Long, lngRows As Long, lngVisibleRows As Long
    
        Set rngConsider = .Range("A1:A" & lngLastRow)
    
        lngRows = rngConsider.Rows.Count
        lngVisibleRows = rngConsider.SpecialCells(xlCellTypeVisible).Rows.Count
        lngHiddenRows = lngRows - lngVisibleRows
    
        MsgBox "There are " & lngHiddenRows & " hidden rows."
    
    End With
    
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using SSRS 2008. I am hiding some of the rows based on
I have a bunch of table rows that I'm hiding/showing using checkboxes and jQuery.
I have a table and I am hiding some rows. I want to get
I am hiding an element using inline css, like so: <span class=hidden-nojs style=display:none>Some text</span>
I am attempting to hide some rows in an excel sheet using C#. but
I have a table, now on load i am hiding few last rows.Now on
I have a HTML table where I am dynamically adding and hiding rows and
Over the years there must be a dozen ways to show/hide rows or showing/hiding
How much information hiding is necessary? I have boilerplate code before I delete a
I am showing/hiding a div depending where I click with this code: $(body).click(function(e) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.