Two dinamic graphs in a worksheet

A

Arno

Hello,

In a worksheet I have two dinamic graphs and its data.
Unfortunately the second graph is not working properly.

I think that the problem is with the syntax of the macro of the second
graph, probably with the (AutoFilter Field:=1)???? because the macro should
only select the cells with the data but instead it is picking up also the
empty cells in the column and eventlually the graph is incorrect.

Please see below the macros

Really appreciate if you can help to fix this.

Thank you ! Arno


MACRO OF THE FIRST DINAMIC GRAPH - THIS ONE WORKS OK!
Sub SelData()
Columns("T:U").Select
Selection.ClearContents
Range("N1:O10000").Select
ActiveSheet.Range("$N$1:$O$10000").AutoFilter Field:=1, Criteria1:="<>"
Range("N1:O10000").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Range("T1").Select
ActiveSheet.Paste
ActiveSheet.Range("$N$1:$O$10000").AutoFilter Field:=1
End Sub

MACRO OF THE 2ND GRAPH###THIS ONE IS NOT WORKING :)
Sub SelDataManuf()
Columns("AD:AE").Select
Selection.ClearContents
Range("AA1:AB10000").Select
ActiveSheet.Range("$AA$1:$AB$10000").AutoFilter Field:=1, Criteria1:="<>"
Range("AA1:AB10000").Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection.Copy
Range("AD1").Select
ActiveSheet.Paste
ActiveSheet.Range("$AA$1:$AB$10000").AutoFilter Field:=1
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top