LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Pivot Table NewSheet Event Hide Columns

OK here is what I'm trying to do... I have a pivot table and when I
drill down into it I want specific cell names to hide it's column when
the new sheet pops up. I have the code to just be able to do this
with an active sheet, but I can't seem to adopt this to a new sheet
event. And to make things a little more difficult, I already have one
new sheet event for formatting. Anyway, here is what I have so far:

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Application.EnableEvents = False
If Not Intersect(Target, Range("B1")) Is Nothing Then
If UCase(Range("B1").Value) = "YES" Then
Columns(2).Hidden = True
Else
Columns(2).Hidden = False
End If
End If
Application.EnableEvents = True
End Sub

Private Sub Workbook_NewSheet(ByVal Sh As Object)
Columns("B:B").NumberFormat = "$#,###"
Rows("1:1").Select
Selection.Font.ColorIndex = 37
With Selection.Interior
.ColorIndex = 15
.Pattern = xlSolid
End With
Selection.Interior.ColorIndex = 55
Range("F5").Select
End Sub

Thanks

Tyson
 
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 pivot table forest Excel Discussion (Misc queries) 3 January 22nd 10 04:13 PM
Excel Pivot Table: Hide Detail Columns and KEEP Totals? [email protected] Excel Discussion (Misc queries) 0 November 29th 07 08:51 PM
hide and unhide sum in pivot table Pé Excel Worksheet Functions 3 March 8th 07 11:15 PM
Hide 0% figures in Pivot Table Matt D Francis Excel Worksheet Functions 4 November 4th 05 09:46 AM
Pivot Table Refresh VBA Event keepitcool Excel Programming 0 October 6th 03 04:31 PM


All times are GMT +1. The time now is 06:02 PM.

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"