Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 144
Default Ensuring Autofilter arrows are visible at end of macro

Hi,

I've been struggling with this one for a while -- I have a spreadsheet where
the user may or not have the Autofilter arrows being displayed prior to
running a macro. I always want to have the Autofilter arrows displayed for
all columns with values in Row 1 when the macro completes, regardless of if
the Autofilter arrows were on display prior to the person running the macro.
Below is the code I have tried, but I am getting an error (See error message
below). Any help is appreciated!

Error:
Run-time error '1004: AutoFiler method of Range class failed

Code:
With Sheets("Patent data with family data")

If .FilterMode Then
.ShowAllData
Else
.Range("A1:V1").AutoFilter VisibleDropDown:=True
End If

End With


--
Robert
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Ensuring Autofilter arrows are visible at end of macro

Sometimes your code needs to see all the data.

So I turn off the autofilter, do the work, and reapply data|Filter|autofilter

With Sheets("Patent data with family data")

.autofiltermode = false

'do the work

'apply the autofilter to all the columns in the used range
.usedrange.columns.autofilter

End With

robs3131 wrote:

Hi,

I've been struggling with this one for a while -- I have a spreadsheet where
the user may or not have the Autofilter arrows being displayed prior to
running a macro. I always want to have the Autofilter arrows displayed for
all columns with values in Row 1 when the macro completes, regardless of if
the Autofilter arrows were on display prior to the person running the macro.
Below is the code I have tried, but I am getting an error (See error message
below). Any help is appreciated!

Error:
Run-time error '1004: AutoFiler method of Range class failed

Code:
With Sheets("Patent data with family data")

If .FilterMode Then
.ShowAllData
Else
.Range("A1:V1").AutoFilter VisibleDropDown:=True
End If

End With

--
Robert


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Ensuring Autofilter arrows are visible at end of macro

Try:
..Range("A1:V1").AutoFilter Field:=1, VisibleDropDown:=True
instead of:
..Range("A1:V1").AutoFilter VisibleDropDown:=True

--
p45cal


"robs3131" wrote:

Hi,

I've been struggling with this one for a while -- I have a spreadsheet where
the user may or not have the Autofilter arrows being displayed prior to
running a macro. I always want to have the Autofilter arrows displayed for
all columns with values in Row 1 when the macro completes, regardless of if
the Autofilter arrows were on display prior to the person running the macro.
Below is the code I have tried, but I am getting an error (See error message
below). Any help is appreciated!

Error:
Run-time error '1004: AutoFiler method of Range class failed

Code:
With Sheets("Patent data with family data")

If .FilterMode Then
.ShowAllData
Else
.Range("A1:V1").AutoFilter VisibleDropDown:=True
End If

End With


--
Robert

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Autofilter: jump from visible row to visible row by command button [email protected] Excel Programming 0 November 4th 06 09:04 PM
Formula Auditing Arrows Not Visible Barb Excel Worksheet Functions 0 October 18th 06 03:11 PM
red autofilter arrows instead of blue in Excel? Trader D Excel Discussion (Misc queries) 1 August 28th 06 04:36 AM
excel formula auditing arrows not visible Crookie74 Excel Worksheet Functions 0 March 8th 06 02:14 PM
Invisible AutoFilter Drop-Down Arrows Brian Arnold Excel Programming 3 July 30th 04 07:51 PM


All times are GMT +1. The time now is 05:42 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"