+ Reply to Thread
Results 1 to 4 of 4

Simple macros question

  1. #1
    Eric M.
    Guest

    Simple macros question

    I have written a short macros to sample and average data sets and post the
    average to a separate cell. I have the macros to repeat 100 times, 100
    averages, but don't know how to have it post each average to a progressive
    cell. In other words, post the first average to one cell, then index down
    for the next average and next,... till there is a list of 100 averages.
    After that, I will do more with the data, but need to get by this step first.

  2. #2
    Martin Krastev
    Guest

    RE: Simple macros question

    let's assume that the cell, where you

    "Eric M." wrote:

    > I have written a short macros to sample and average data sets and post the
    > average to a separate cell. I have the macros to repeat 100 times, 100
    > averages, but don't know how to have it post each average to a progressive
    > cell. In other words, post the first average to one cell, then index down
    > for the next average and next,... till there is a list of 100 averages.
    > After that, I will do more with the data, but need to get by this step first.


  3. #3
    Martin Krastev
    Guest

    RE: Simple macros question

    Let's say that the cell where you put the first average is "B1"
    You have a macro function getAverage
    then try the following

    dim avg as double
    dim r as integer
    dim cB1 as range
    set cB1 = range ("B1")
    for r = 1 to 100
    avg=getAverage
    cB1.Offset(r,0).value=avg
    next r

    "Eric M." wrote:

    > I have written a short macros to sample and average data sets and post the
    > average to a separate cell. I have the macros to repeat 100 times, 100
    > averages, but don't know how to have it post each average to a progressive
    > cell. In other words, post the first average to one cell, then index down
    > for the next average and next,... till there is a list of 100 averages.
    > After that, I will do more with the data, but need to get by this step first.


  4. #4
    Eric M.
    Guest

    RE: Simple macros question

    Thanks, I'll give it a try.

    "Martin Krastev" wrote:

    > Let's say that the cell where you put the first average is "B1"
    > You have a macro function getAverage
    > then try the following
    >
    > dim avg as double
    > dim r as integer
    > dim cB1 as range
    > set cB1 = range ("B1")
    > for r = 1 to 100
    > avg=getAverage
    > cB1.Offset(r,0).value=avg
    > next r
    >
    > "Eric M." wrote:
    >
    > > I have written a short macros to sample and average data sets and post the
    > > average to a separate cell. I have the macros to repeat 100 times, 100
    > > averages, but don't know how to have it post each average to a progressive
    > > cell. In other words, post the first average to one cell, then index down
    > > for the next average and next,... till there is a list of 100 averages.
    > > After that, I will do more with the data, but need to get by this step first.


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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