ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ActiveSheet.ShowAllData shows everything - way to have hidden _not_ show up? (https://www.excelbanter.com/excel-programming/303482-activesheet-showalldata-shows-everything-way-have-hidden-_not_-show-up.html)

StargateFanFromWork

ActiveSheet.ShowAllData shows everything - way to have hidden _not_ show up?
 
The syntax below is fantastic. It "unfilters" everything. I added part of
the code to 4 printing scripts so that after printing, the records would all
be shown. Like I said, it works very well for filtered records.

---------------------------------------------------------
Sub ShowAllData()
'
'
On Error Resume Next
ActiveSheet.ShowAllData
If Err.Number < 0 Then MsgBox "All the data is being displayed."
On Error GoTo 0

End Sub
---------------------------------------------------------

What I just noticed is that as we now have a number of closed records that
no longer need tracking, I hid those rows from the ones still in progress.
So we no longer need rows that are hidden to be revealed. The code above
does not distinguish between hidden or hidden due to filtering.

I'm guessing there might not be a way around that but figured I won't know
till I ask.

Ultimately, we need to unhide rows that have been filtered but not that have
actually been hidden.

Is there a way to programmatically have Excel distinguish between the two?

Thank you.



Dave Peterson[_3_]

ActiveSheet.ShowAllData shows everything - way to have hidden _not_show up?
 
Not that I know.

But maybe you could add a helper column and use that as a flag.

Then .showalldata and come back and filter on that flag column to hide the flag.

This may be a better way to keep track/count stuff, too. (Especially if someone
unhides things by mistake.)

StargateFanFromWork wrote:

The syntax below is fantastic. It "unfilters" everything. I added part of
the code to 4 printing scripts so that after printing, the records would all
be shown. Like I said, it works very well for filtered records.

---------------------------------------------------------
Sub ShowAllData()
'
'
On Error Resume Next
ActiveSheet.ShowAllData
If Err.Number < 0 Then MsgBox "All the data is being displayed."
On Error GoTo 0

End Sub
---------------------------------------------------------

What I just noticed is that as we now have a number of closed records that
no longer need tracking, I hid those rows from the ones still in progress.
So we no longer need rows that are hidden to be revealed. The code above
does not distinguish between hidden or hidden due to filtering.

I'm guessing there might not be a way around that but figured I won't know
till I ask.

Ultimately, we need to unhide rows that have been filtered but not that have
actually been hidden.

Is there a way to programmatically have Excel distinguish between the two?

Thank you.


--

Dave Peterson



All times are GMT +1. The time now is 03:57 AM.

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