Macro to create chart with sort function

Faintkitara

Board Regular
Joined
Jun 23, 2016
Messages
59
Hello,

I would like to create a chart in another worksheet (starting at cell N4) that pulls data from the current worksheet labeled " Time"

There are several pieces of data listed in "Time" but the only thing that I care about are three columns that arent' next to each other labeled "Name" "Customer" "Projection" on row four.

In "Projection" I would like to sort the values so that only values above 2000 and below -2000 are selected. values are sorted from highest to lowest I would also like to keep the colors and cell formatting.

After that, I would like to copy and paste all three columns into cell N4 on another worksheet titled "Pivot" starting in cell N-4.

Thank you and I appreciate if any of you can be of any assistance.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
I started off with some code to sort the values in "Projection", this doesnt include any copying or pasting yet..

Code:
Sub FilteringData()



Dim i As Integer, rngData As Range


Set rngData = ActiveSheet.Range("A4")
i = Application.WorksheetFunction.Match("Projection", Range("A1:AZ1"), 0)


rngData.AutoFilter Field:=i, Criteria1:=">2499", Operator:=xlAnd, Criteria2:="<-2499"


End Sub
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,835
Members
449,471
Latest member
lachbee

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top