vba code help

isacp

Board Regular
Joined
Dec 16, 2004
Messages
135
i would like to write a macro that makes a chart.
i want to write at each change in column c
charts.add ...............

i dont know the code that will say 'at each canhge in column c do somthing
can you help me
once again thank you
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Use the macro recorder to create the code for the chart. You could end up with a hell of a lot of charts. Are you sure thats what you want - a new chart every time?
 
Upvote 0
thanx fo you help

the thing is that the part of the code with the chart i have i need the part
"at each change in"
you see i have a sales report and in column c are each salesreps department so i want a chart for each dept.
so the code i need is
at each change in
the truth is this applies for anything
"at each change in c.copy.range("F:F")"
if you could write me that code that would be great
thank you again for your time.
it appreciated
 
Upvote 0
Hi again, when you have a chart it has a source range it looks at to get its values. When the data in the source changes it automatically updates. The only thing you may need to do is extend the range it looks at if you add more data.

Im not sure what you mean by c.copy.range("F:F")" . Do you want to copy the whole row of C and paste into F? Again, try the macro recorder to see the code for this.
 
Upvote 0
every day i get a report i get a daily report a weekly and a monthly.
the report has (in order of columns) the persons department his name date and the five different figures.
right now i manually make a chart for each dept. consisting of the names and figures. i have five charts for each dept. the people change dept. daily and so this is for a daily process.
i want to write a macro that makes a chart based on the department the person is in?
againg i appreciate your help and if i can clarify aby further please ask i will try
thank you
 
Upvote 0
The steps I see you would need are

1) Filter the data to only show the one you need
2) Copy that data to another sheet
3) Create a chart off the data

In order to do code you need to be specific about where ranges are copying from and where they are going to. If you use the macro recorder to achieve these three steps then you will have the bulk of the code. Then a small piece of code could be added to repeat the process (ie, filter on the next one, copy to a new sheet, create a chart). Run the macro to do the action for one department then post the code and Ill help with th loop part. You may wish to create a list of all the departments so its just a matter of looping through this to determine the filter criteria.

You could also investigate using a pivot chart - look that up in the help.

hth
 
Upvote 0

Forum statistics

Threads
1,222,415
Messages
6,165,896
Members
451,993
Latest member
rowebca

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