473,396 Members | 1,923 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 -
Expand|Select|Wrap|Line Numbers
  1. Sheets("Monthly SuperMetrics Data").Select
  2. Cells(4, 1).Select
  3. Do Until Selection = ""
  4.         If Selection = "% of Total VDP Views for New Vehicles" Then
  5.         varRow = ActiveCell.Row
  6.         End If
  7. Selection.Offset(1, 0).Select
  8. Loop
  9. stringvariable = Trim(Str(varRow))
  10. ChartRange = RangeStart + "3:" + RangeEnd + "3," + RangeStart + stringvariable + ":" + RangeEnd + stringvariable
  11. Sheets("SuperMetrics Graphing").Select
  12. ActiveSheet.ChartObjects("Chart 69").Activate
  13. ActiveChart.ChartArea.Select
  14. ActiveChart.ChartType = xlLineMarkers
  15. ActiveChart.SetSourceData Source:=Sheets("Monthly     SuperMetrics Data").Range(ChartRange), PlotBy:=xlRows ActiveChart.Location Where:=xlLocationAsObject, Name:= _
  16.         "SuperMetrics Graphing"
  17. ActiveChart.HasDataTable = False
Jul 20 '10 #1
1 1341
NeoPa
32,556 Expert Mod 16PB
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.
Jul 21 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Martin Magnusson | last post by:
I'm using a matrix and vector library, that won't compile. When running g++ I get the error message "macro "minor" passed 5 arguments, but takes just 1" The definition of "minor" looks like...
5
by: Krisnamourt Correia via SQLMonster.com | last post by:
I have one query that executes many times in a week. I created one Maintenances plan that Rebuild all index in my Database that has been executed at 23:40 Saturday until stop finished at Sunday. ...
1
by: Todd Peterson | last post by:
I'm a newbie to DB2 and am trying to figure out how to write a stored procedure, using dynamic SQL statements to return a result set. I believe the majority of the hurdles I have been facing might...
10
by: andrew browning | last post by:
i have overlaoded all of my arithmetic operators but all are functioning as multiplication. below is a sample of the addition operator: Rational operator + (const Rational& r1, const Rational&...
3
by: Peter | last post by:
Hello all, I have the following t-sql batch: create procedure stp_test ( @p_date1 as datetime = null, @p_date2 as datetime = null )
0
by: RayV | last post by:
I have a report based on a query that summarizes data by county that is giving me the wrong result. In the county header I have a text box with this control source =Avg() The data is Null...
3
by: =?Utf-8?B?cmNoZg==?= | last post by:
I know this is simple problem but I am so new that there is some fundamental disconnect in my understanding of: Enumerable, Enumerator, and Generics. As a result I am having a problem debugging...
2
by: Mayank1717 | last post by:
I am trying to change date into number format for that i am using formatnumber function but this function returning wrong result. for example : numeric value of 12/09/2007 is 39337 but it...
2
by: GaryDean | last post by:
The following command... string DebugString = System.Web.HttpContext.Current.Server.MapPath("App_Themes"); is executed from my ThemeManager.cs class in my App_code directory It returns......
3
by: canabatz | last post by:
im using paging on this query: i got this code that returning wrong results: (SELECT bid_price, count(*) as n from bidding_details where bid_id=$bid_id GROUP BY bid_price DESC HAVING n = 1 ) ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.