the following will graph data in column J.
I don't understand what you mean by :
Quote:
and the corresponding value in the column M
|
Code:
Option Explicit
Sub y()
Application.ScreenUpdating = False
Worksheets("Sheet1").Range("J2").AutoFilter _
Field:=1, _
Criteria1:=">" & "14" ', _
Dim Sorce, Targt As Worksheet
Set Sorce = ThisWorkbook.Sheets("Sheet1")
Set Targt = ThisWorkbook.Sheets("Sheet2")
Sorce.Range("J2:J100").SpecialCells(xlCellTypeVisible).Copy
Targt.Cells(1, 1).PasteSpecial
Sheets("Sheet2").Activate
Sheets("Sheet2").Range("A1").Select
Macro1
Range("A1").Select
Application.CutCopyMode = False
Application.Wait Now + #12:00:02 AM#
Sheets("Sheet1").Activate
Range("A1").Select
On Error Resume Next
'If ActiveSheet.FilterMode Then ActiveSheet.ShowAllData
'If ActiveSheet.AutoFilterMode Then ActiveSheet.ShowAllData
Cells.AutoFilter
Application.ScreenUpdating = True
End Sub
Sub Macro1()
'
' Macro1 Macro
'
'
ActiveSheet.Shapes.AddChart.Select
Dim rng As Range
Dim cht As Object
Dim LastRow As Long
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
Set rng = ActiveSheet.Range("A1:A" & LastRow)
'rng.Select
ActiveChart.SetSourceData Source:=rng
ActiveChart.ChartType = xlColumnClustered
End Sub