Can't name the sheet with the chart!!!
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Can't name the sheet with the chart!!!

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Milwaukee, WI
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Is there some reason why everytime I get to the line that names a new sheet for a chart I get some error that immediately ends the sub-routine? No dialog box or anything; it just skips the rest of the routine and exits the Sub. Here's the code:

    Selection.Activate
    Charts.Add
    ActiveChart.ChartType = xl3DArea
    ActiveChart.SetSourceData Source:=Sheets("WIP2").Range("B" & LastRow + 1 & ":" & RightFill), PlotBy:= _
    xlRows
    ActiveChart.SeriesCollection(1).XValues = "=WIP2!R1C2:R1C50"
    If LoanBorrow = "LOANS" Then
    ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Monthly Average Loans" 'Right here it breaks off
    ElseIf LoanBorrow = "BORROWS" Then
    ActiveChart.Location Where:=xlLocationAsNewSheet, Name:="Monthly Average Borrows"
    End If
    With ActiveChart
    .HasTitle = True
    .ChartTitle.Characters.text = "Average Monthly Nominals For " & Client & " For The Past " & MnthAvgCount & " Months"
    .Axes(xlCategory).HasTitle = False
    .Axes(xlSeries).HasTitle = False
    .Axes(xlValue).HasTitle = True
    .Axes(xlValue).AxisTitle.Characters.text = "Average Nominals (000)"
    End With

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Millbank, London, UK
    Posts
    1,790
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I'll just send this to the top of the list with a "is that a Euro symbol" comment....

    Is that a Euro symbol ?

    Maybe this will trigger something with the VBA experts....


    :: Pharma Z - Family drugstore ::

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Milwaukee, WI
    Posts
    105
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Yes indeed, that is a Euro symbol, but that can't be the problem as (a) it's just in the axis title as text" and (b) it's not the axis title that has the error, it's the chart title.

    Any other ideas?

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

DMCA.com