LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Another Hide Columns Question

I am running Excel 2003 and need help with a macro. I have a table consisting
of Region, Stores and Monthly Sales. I wrote a macro to filter (hide) Stores
depending on the Region.

Region Store Sales City
Region1 Store1 $170K City1
Region1 Store2 $160K City2
Region2 Store1 $220K City1
Region2 Store3 $250K City1
Region3 Store1 $200K City2

In the following macro, the target value of A1 (Region) is located on
another worksheet, but I want to use that information to hide the Store
(column) that are not in the Region. When I run the macro, there is no change
in the results.

Any help would be greatly appreciated

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("A1"), Target) Is Nothing Then
Range("A:D").EntireColumn.Hidden = False
If Target.Value = "Region1" Then
Range("A:B").EntireColumn.Hidden = True
Range("C:D").EntireColumn.Hidden = False
Else
Range("A:B").EntireColumn.Hidden = False
Range("C:D").EntireColumn.Hidden = True
End If
End If
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
Hide/Unhide columns using button on top over relevant columns [email protected] Excel Discussion (Misc queries) 1 March 7th 07 09:24 PM
Hide Columns hajo Excel Worksheet Functions 4 September 2nd 06 08:09 PM
Hide Rows / Columns - complex question lw new guest Excel Worksheet Functions 2 August 18th 05 08:02 PM
Hide columns alm09 Excel Discussion (Misc queries) 1 June 27th 05 04:14 PM
hide columns varun Excel Worksheet Functions 1 December 2nd 04 10:05 AM


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