Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Error 400 on running Macro

I have created a little macro that:

1) Goes to a specific sheet;
2) Unhides a certain range of cells;

This small macro works well for me.

Coding is:

Sub Yr1unhide()
Sheets("Data").Select
Application.Goto Reference:="Year1"
Selection.EntireColumn.Hidden = False
End Sub

However I then tried to add in a filter so that only rows that have a value
of "1" in the filter column (ES) are shown. But now when I run the macro a
error box pops up with a value of 400 in it, and no other information.

Sub Yr1unhide()
Sheets("Data").Select
Application.Goto Reference:="Year1"
Selection.EntireColumn.Hidden = False
Range("ES2").Select
Selection.AutoFilter
Selection.AutoFilter Field:=1, Criteria1:="=1", Operator:=xlAnd
End Sub

Can anyone help?
Regards

James
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Error 400 on running Macro

I think you cannot hide/unhide a column once a filter has been applied.
This is an Excel limitation. Try removing the filter before.

Regards,
Karim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Error 400 on running Macro

I think you cannot hide/unhide a column once a filter has been applied.
This is an Excel limitation. Try removing the filter before.

Regards,
Karim

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
Error 400 when running Macro Jim@Tech Excel Discussion (Misc queries) 3 October 20th 08 05:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Worksheet Functions 1 May 3rd 08 02:35 PM
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable Enda80 Excel Discussion (Misc queries) 1 May 3rd 08 10:52 AM
Error Running a Macro viddom Excel Discussion (Misc queries) 3 July 28th 05 01:56 PM
Error when running macro Rob Excel Programming 2 December 9th 04 07:20 AM


All times are GMT +1. The time now is 08:35 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"