Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

advanced excel course london - naming charts created macro

Forum home » Delegate support and help forum » Microsoft Excel Training and help » advanced excel course london - Naming Charts Created by a Macro

advanced excel course london - Naming Charts Created by a Macro

ResolvedVersion Standard

Zohra has attended:
Excel Advanced course
Excel Intermediate course
Excel VBA Intro Intermediate course

Naming Charts Created by a Macro

Hello,

I've set up a macro to create a couple of charts. I'd like the end of the macro to resize the graphs and have done this by recording another macro. However, I can't seem to get the end to refer to the right chart object- is there a way of naming the chart so that I can use

ActiveSheet.Shapes("Chart Name").IncrementTop XX

?

RE: Naming Charts Created by a Macro

Adding in an example of where it goe swrong:

ActiveChart.Name = "Chart 13"
'at this point the chart is named "Chart 13"

ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
'at this point it changes and the next line produces an error

ActiveChart.Name = "Chart 13"

RE: Naming Charts Created by a Macro

Zohra

i think that you may need to reselect the chart ie

use Charts("Chart 13").Select

instead of the line ActiveChart.Name = "Chart 13".

If that doesn't work you could send the spreadsheet where the error occurs to

info AT stl-training.co.uk and mark it to the attention of Carlos

I'll have a look at how the code is working and hopefully come up with an answer.

Regards

Carlos

Excel tip:

Creating a range of monthly payments as text

You could use a formula to create a range of payment ie. payment amount for x% to y% rate with fixed terms and principle.

The text that would be "between Xamount and Yamount".

Here is how to do it.

1 Use the PMT function to get your monthly payments figure or whatever frequency of payments that you choose he start range.

See PMT under Excel Help

2. Nest these in the ROUND function to round decimals see ROUND under Excel Help


3. Concatenate this using "&" and concatenate " to " and concatenate "Between ".

4. Concatenate the above to PMT function for the end range

ie.

="Between "&ROUND((PMT1),decimal places)&" and "&ROUND((PMT2),decimal places)

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.