Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / May 2008

Tip: Looking for answers? Try searching our database.

Plotting and selecting data

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Matt S - 29 May 2008 00:19 GMT
Hello, I have a long-winded question:

I am analyzing data that goes in a sequence.  I have:
Segments 1-15 as the first part of my test
Segments 16-18 as the second part of my test.

My macro calculates the time elapsed from segments 1-15 in column AO and
16-18 in column AQ.  If the time period is not running, then I have it
specified to pump out "" as the output.  What I'd like to do is plot my
y-axis data in column AI in two graphs:  AI versus AO and then another AI
versus AQ.  I do not know how to make the macro realize when the timer has
started in the segment and when it has ended so that I can plot my graphs, as
the starting row is never the same between files.

Any help would be appreciated!
Thanks!
<3 Matt
Jon Peltier - 29 May 2008 02:03 GMT
Does the timer increment for several rows, then revert to zero? You could
test for the timer value, and if it is greater than the pervious value, it's
continuing, otherwise it's starting over. This blog post features a VBA
procedure that similarly divides columns into chart series based on a test
of values in a column:

http://peltiertech.com/WordPress/2008/05/22/vba-to-split-data-range-into-multipl
e-chart-series/


- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______

> Hello, I have a long-winded question:
>
[quoted text clipped - 14 lines]
> Thanks!
> <3 Matt
Matt S - 29 May 2008 12:36 GMT
No, essentially what I have is the following:

data  time1
data  time1
data  time1
data           time2
data           time2
data           time2

What I'd like to do is to start/end the series when time begins/ends.

Matt

> Does the timer increment for several rows, then revert to zero? You could
> test for the timer value, and if it is greater than the pervious value, it's
[quoted text clipped - 29 lines]
> > Thanks!
> > <3 Matt
Jon Peltier - 29 May 2008 13:40 GMT
If you change "" to NA() in the formula, you will get something that looks
like this:

data  time1  #N/A
data  time1  #N/A
data  time1  #N/A
data  #N/A  time2
data  #N/A  time2
data  #N/A  time2

The #N/A errors look ugly, but they are omitted in a line or XY chart
(rather than plotting as a zero).

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______

> No, essentially what I have is the following:
>
[quoted text clipped - 48 lines]
>> > Thanks!
>> > <3 Matt
Matt S - 29 May 2008 14:08 GMT
That would work... I guess what I was looking for was to define variables as
the rows that time1/2 starts and ends.  Then I can use those variables to
define the ranges of the charts.

Is there an easy way to define these variables?

> If you change "" to NA() in the formula, you will get something that looks
> like this:
[quoted text clipped - 68 lines]
> >> > Thanks!
> >> > <3 Matt
Matt S - 29 May 2008 14:25 GMT
Actually, adding #N/A messes up all my other calculations.  :(

> If you change "" to NA() in the formula, you will get something that looks
> like this:
[quoted text clipped - 68 lines]
> >> > Thanks!
> >> > <3 Matt
Jon Peltier - 29 May 2008 22:55 GMT
Worksheet columns are cheap. Keep the original table as is, and use it for
display and for subsequent calculations. Then create another range that uses
formulas like =IF(LEN(B2)=0,NA(),B2), and use these columns for chart source
data.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
Peltier Technical Services, Inc. - http://PeltierTech.com
_______

> Actually, adding #N/A messes up all my other calculations.  :(
>
[quoted text clipped - 78 lines]
>> >> > Thanks!
>> >> > <3 Matt
Matt S - 29 May 2008 15:10 GMT
I think I got it Jon... it will run slow, but it will work.  Any way to speed
up this code?

   Dim FirstData As Long
   Dim LastData As Long
   
   Range("AQ15").Select
   Do Until Not ActiveCell = ""
       Selection.Offset(1, 0).Select
   Loop
       
   FirstData = ActiveCell.Row
   
   Do Until ActiveCell = ""
       Selection.Offset(1, 0).Select
   Loop
   
   LastData = ActiveCell.Row - 1

Then I will use First and Last data variable to define my rows in the graphs.

> If you change "" to NA() in the formula, you will get something that looks
> like this:
[quoted text clipped - 68 lines]
> >> > Thanks!
> >> > <3 Matt
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.