ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   select all (including hidden) rows in autofilter region (https://www.excelbanter.com/excel-programming/433425-select-all-including-hidden-rows-autofilter-region.html)

Tekito

select all (including hidden) rows in autofilter region
 
(for Excel 2003)
If a section of a worksheet has been autofiltered, macro commands involving
ranges of several rows might give unexpected results. Sometimes only the
visible rows are affected, even if all the row numbers (visible and hidden)
were selected in the macro. I need a way to predictably select and
manipulate all rows regardless of what is being autofiltered.

I understand Excel's approach, that oftentimes it makes sense to only deal
with the visible rows and filter out the hidden ones. However, in many
cases, this assumption seems flawed. I don't know what the user has chosen
to autofilter; my macro needs to run updates regardless of what he is
currently viewing. I would hate to check if every row is hidden for every
bit of code I've written....



JLGWhiz[_2_]

select all (including hidden) rows in autofilter region
 
Then include code to unhide the row or columns into your macro.


"Tekito" wrote in message
...
(for Excel 2003)
If a section of a worksheet has been autofiltered, macro commands
involving
ranges of several rows might give unexpected results. Sometimes only the
visible rows are affected, even if all the row numbers (visible and
hidden)
were selected in the macro. I need a way to predictably select and
manipulate all rows regardless of what is being autofiltered.

I understand Excel's approach, that oftentimes it makes sense to only deal
with the visible rows and filter out the hidden ones. However, in many
cases, this assumption seems flawed. I don't know what the user has
chosen
to autofilter; my macro needs to run updates regardless of what he is
currently viewing. I would hate to check if every row is hidden for every
bit of code I've written....





Tekito

select all (including hidden) rows in autofilter region
 
I guess I'll have to do that. I mean, yes, maybe it's not a big deal, but
I'm not really looking forward to going through all my macros and editing the
code whenever I reference a range. To me, the autofilters are merely a user
interface option, so they really shouldn't be affecting your basic macro
logic. Maybe its helpful in some situations, but a real pain in others. Not
to mention the user probably doesn't appreciate his autofilter being disabled
everytime a background macro runs. But whatever, I guess it is workable.

"JLGWhiz" wrote:

Then include code to unhide the row or columns into your macro.


"Tekito" wrote in message
...
(for Excel 2003)
If a section of a worksheet has been autofiltered, macro commands
involving
ranges of several rows might give unexpected results. Sometimes only the
visible rows are affected, even if all the row numbers (visible and
hidden)
were selected in the macro. I need a way to predictably select and
manipulate all rows regardless of what is being autofiltered.

I understand Excel's approach, that oftentimes it makes sense to only deal
with the visible rows and filter out the hidden ones. However, in many
cases, this assumption seems flawed. I don't know what the user has
chosen
to autofilter; my macro needs to run updates regardless of what he is
currently viewing. I would hate to check if every row is hidden for every
bit of code I've written....







All times are GMT +1. The time now is 10:44 AM.

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