ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Advanced filter in VBA messing with my chart (https://www.excelbanter.com/excel-programming/418465-advanced-filter-vba-messing-my-chart.html)

Jennifer

Advanced filter in VBA messing with my chart
 
Ok let me say i fully understand how to name a range and in the source data
for a chart you use the formula =sheetname!rangename

Problem arrises when my macro that runs an advanced filter with the source
data and add data to the bottom of the range the chart reverts back to it's
initial data source =sheet1!$a$4:$b$15

so even though it accept the named range intitailly once the advanced filter
runs it ommits the named range. I am using 2007 and i never had this
problem in 2003.

What suggestions do you have for me? At the bottom you will see my code.
Thank you!!!!!
--
Thank you,

Jennifer

--
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
''ActiveSheet.Unprotect
'On Error GoTo ws_exit
'Application.EnableEvents = False
'If Target.Row = 3 And Target.Column = 2 Then
''calculate criteria cell in case calculation mode is manual
' Worksheets("TankInventory").Range("ac2:ad2").Calcu late
' Worksheets("TankInventory").Range("Inventory_Pivot Table") _
' .AdvancedFilter Action:=xlFilterCopy, _
' CriteriaRange:=Sheets("TankInventory").Range("ac1: ad2"), _
' CopyToRange:=Range("a6:b6"), Unique:=False
' Me.Range("B3").Select
'End If
'ws_exit:
' Application.EnableEvents = True
' 'ActiveSheet.Protect


All times are GMT +1. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com