ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   unhidden row (https://www.excelbanter.com/new-users-excel/177505-unhidden-row.html)

Nahc

unhidden row
 
May I know how to number unhidden rows only

Don Guillett

unhidden row
 
I never felt a need to do this but this should do it.

Sub numbervisiblerows()
mc = 2'column number to check 2 is column B
For i = 1 To Cells(Rows.Count, mc).End(xlUp).Row
If Rows(i).Hidden = False Then Cells(i, mc -1) = j
j = j + 1
Next i
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Nahc" wrote in message
...
May I know how to number unhidden rows only



Nahc

unhidden row
 
sorry sir, is there a simpler explanation ?

"Don Guillett" wrote:

I never felt a need to do this but this should do it.

Sub numbervisiblerows()
mc = 2'column number to check 2 is column B
For i = 1 To Cells(Rows.Count, mc).End(xlUp).Row
If Rows(i).Hidden = False Then Cells(i, mc -1) = j
j = j + 1
Next i
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Nahc" wrote in message
...
May I know how to number unhidden rows only





All times are GMT +1. The time now is 02:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com