+ Reply to Thread
Results 1 to 5 of 5

find continuous data range

  1. #1
    Registered User
    Join Date
    04-18-2009
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    5

    find continuous data range

    I received some help yesterday to find a continuous data range in Column A of a worksheet with a header in A1. But now I'm thinking that I asked the wrong question.

    Each day I have new data (a series of numbers) that are moved into column A of a spreadsheet. I never know ahead of time how many numbers will be in the data set. And I need to perform a series of calculations on the data. I need to do the following:

    1. Find the range of the data set.
    2. Perform a series of calculations on the data set.
    3. Report the results in a new location.

    If #1 is pre-defined, then #2 and #3 are very easy. However, #1 is causing problems. I can find the range as a string (yesterday's help):

    Please Login or Register  to view this content.
    and I can view the range of cells in a message box (e.g. A2:A101). But if I try to pass this information to a formula, I get an error.

    Any help would be appreciated.

    Thanks.
    Last edited by ConfusedToo; 04-19-2009 at 11:05 AM. Reason: SOLVED

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988

    Re: find continuous data range

    What's the formula?

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: find continuous data range

    You don't say how you tried to use it, but you could for example set a range to a variable and then use that in a formula. Below sums the values of cells in the range.
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-18-2009
    Location
    New York
    MS-Off Ver
    Excel 2003
    Posts
    5

    Talking Re: find continuous data range

    Thanks very much, Stephen. I was trying to do it this way (below), which does not work (following your "Sum" example):

    Range("C1").Formula = "=Sum(r)"
    However, your solution does work (below):

    Range("C1") = WorksheetFunction.Sum(r)
    To VBA Noob:
    In this procedure, I'm calculating %RSD of a data set, as a measure of precision. The calculation applies to a log-transformed data set.

    %RSD = 100 * (sqrt(K^((SD)^2)-1)
    where K = 10^ln10

    Thanks very much to both of you. Now I don't have to keep re-defining the data range each day, which has been painful.
    Last edited by ConfusedToo; 04-19-2009 at 11:15 AM. Reason: Adding Quote Tags around code

  5. #5
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: find continuous data range

    If you wanted the formula in the cell you could combine the two methods:
    Please Login or Register  to view this content.

+ 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