LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Need help hiding/unhiding column based on autofilter selection in a different column

If you change your selection of a item from "autofilter list",
Worksheet_Calculate event is triggered,
therefore you can write macro you want using this event procedure.

for example,

Private Sub Worksheet_Calculate()
Dim w As Worksheet, f As Long

Set w = sheet2

With w.AutoFilter
With .Filters
For f = 1 To .Count
With .item(f)
If .On Then

'// When Jan.15,93 is selected, you want to hide some columns
If .Criteria1 Like "*01-15-93" Then

'// Codes Hiding some columns are here
Debug.Print "Hide Columns"
Exit Sub

End If
End If
End With
Next
End With
End With
End Sub

 
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
Change formulas in a column based on a selection. Ephraim Excel Worksheet Functions 3 April 12th 10 06:21 PM
Hiding a column of hyperlinks behind a column of numbers cmiling New Users to Excel 2 November 20th 09 05:02 PM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look [email protected] Excel Discussion (Misc queries) 1 December 27th 06 05:47 PM
Hiding worksheets based on user selection HL Excel Worksheet Functions 3 October 12th 06 04:01 PM
How to sum a column based on the choice of autofilter? Mr.G Excel Programming 2 January 11th 05 04:23 PM


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

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

About Us

"It's about Microsoft Excel"