Identify Hidden but not filtered cells

anshul03

New Member
Joined
Apr 30, 2012
Messages
3
I am trying to extract all the visible worksheets in a few workbooks into double pipe delimited text files. For this I want to take into consideration only the cells that are 'not hidden' on a worksheet.

As per my understanding a cell can be hidden when:
- either its row / column has been manually hidden by user
- or its row has been filtered out due to autofilter applied on header or either of the columns

I want to exclude the manually hidden rows / columns but want to take into consideration the rows that have got hidden due to the applied autofilter.

Can someone suggest me on how to identify cells of this kind. I am currently using the following code, but this leaves out the cells hidden by autofilter as well.


For RowNdx = StartRow To EndRow
If Rows(RowNdx).Hidden = False Then
WholeLine = ""
For ColNdx = StartCol To EndCol
If Columns(ColNdx).Hidden = False Then
If Cells(RowNdx, ColNdx).Value = "" Then
CellValue = Chr(34) & Chr(34)
Else
CellValue = Cells(RowNdx, ColNdx).Value
End If
WholeLine = WholeLine & CellValue & Sep
End If
Next ColNdx
WholeLine = Left(WholeLine, Len(WholeLine) - Len(Sep))
Print #FNum, WholeLine
End If
Next RowNdx

Any prompt help on this shall be highly appreciated!!
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
One way would be clearing the filters, if any is active, to show all filtered range's data.

Manually hidden rows will not be affected by this unless they intersect with the filtered range's rows.
 
Upvote 0

Forum statistics

Threads
1,215,521
Messages
6,125,306
Members
449,218
Latest member
Excel Master

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top