+ Reply to Thread
Results 1 to 5 of 5

Creating a Range of Values to Plot

  1. #1
    Registered User
    Join Date
    04-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    76

    Creating a Range of Values to Plot

    I am importing a text file and plotting some of its contents versus time. The file provides the end time and the step interval. I know that in Matlab you can define a set of values with the start, end, and interval, but I'm having a hard time figuring out how to do this with VBA. I have toyed with fill series, but no luck there.

    Specifically, the file I'm reading in (a relay event file with voltages and currents) gives the maximum cycles as 15 and the samples per cycle as 16. Therefore, for each voltage or current sample, I need the time to show as 1/16, 2/16, 3/16, ..., all the way to 15 cycles. I have tried to manually do this and record the macro, but after I put in a few x/16s, when I try to extend the formulas down the rest of the cells, instead of continuing the trend (4/16, 5/16, 6/16, etc.), it repeats what I put in first. Any advice???

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Creating a Range of Values to Plot

    I don't understand what you are trying to do. Are you trying to fill cells with this data? Can you post a sample sheet?

  3. #3
    Registered User
    Join Date
    04-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Creating a Range of Values to Plot

    yes, I guess the easiest thing to do would be to fill cells with the data. attached is a sample worksheet with the imported file.

    the step interval I want is 1/B6 (1/16), and I want it to end at D6 (15). the data should start on row 8 and end on row 247 (giving 15 cycles of data at steps of 1/16). when trying to fill data into cells, I tried to code it starting in Q8. This data will provide the time information needed to plot various voltages and currents vs. time. in row 7 you will see "IA," "IB," etc. These are the values I am trying to plot vs. time. hope this helps clear things up.
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394

    Re: Creating a Range of Values to Plot

    Try this

    Please Login or Register  to view this content.
    If you want to see 1/16 instead of .06, you may be able to work it out. Otherwise post back

  5. #5
    Registered User
    Join Date
    04-08-2012
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    76

    Re: Creating a Range of Values to Plot

    worked like a charm. thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1