T
Tysone
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
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