My macro is returning the wrong result

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tressmorrell
    New Member
    • Jul 2010
    • 1

    #1

    My macro is returning the wrong result

    I have a series of VBA codes written in Excel to update a number of graphs. However, one section of code is returning the graph results for the code directly preceding it. Here is the code in question -
    Code:
    Sheets("Monthly SuperMetrics Data").Select
    Cells(4, 1).Select
    Do Until Selection = ""
            If Selection = "% of Total VDP Views for New Vehicles" Then
            varRow = ActiveCell.Row
            End If
    Selection.Offset(1, 0).Select
    Loop
    stringvariable = Trim(Str(varRow))
    ChartRange = RangeStart + "3:" + RangeEnd + "3," + RangeStart + stringvariable + ":" + RangeEnd + stringvariable
    Sheets("SuperMetrics Graphing").Select
    ActiveSheet.ChartObjects("Chart 69").Activate
    ActiveChart.ChartArea.Select
    ActiveChart.ChartType = xlLineMarkers
    ActiveChart.SetSourceData Source:=Sheets("Monthly     SuperMetrics Data").Range(ChartRange), PlotBy:=xlRows ActiveChart.Location Where:=xlLocationAsObject, Name:= _
            "SuperMetrics Graphing"
    ActiveChart.HasDataTable = False
    Last edited by NeoPa; Jul 21 '10, 12:04 PM. Reason: Please use the [CODE] tags provided
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    Tress, I fail to see how it would be possible to help with so little information available. I imagine the layout of your worksheet to be critical to even understanding what is supposed to be happening. Your question is also very brief so we're left with very little to work with.

    Comment

    Working...