+ Reply to Thread
Results 1 to 2 of 2

Working with non-specific cell references

  1. #1
    GarethP
    Guest

    Working with non-specific cell references

    I am trying to write a macro that will format a spreadsheet (containing data
    downloaded from a Borland database) and perform quartile analysis on several
    data blocks in the spreadsheet. The problem is that size of the data blocks
    varies depending on the original query that was ran on the database, i.e. I
    can't use specific cell references in the macro.

    The dowloaded data always conforms to a genaral pattern so I've had some
    success with formatting the worskeet using xlLastCell, xldown, etc to move
    around the data. Unfortunately I've hit a brick wall with trying to include
    quartile functions in the macro as they require specific cell references for
    both the range of data to analyse and the cell in which the formula result
    will be displayed.

    I would be very apprreciative if anyone has any ideas that might help me.

    Yours hopefully,

    Gareth Packham
    Analyst
    PriceWaterhouseCoopers

  2. #2
    Peter T
    Guest

    Re: Working with non-specific cell references

    Hi Gareth,

    I assume your formula can work with a Name, and your data is in it's own
    block with headers.

    Dim rng As Range

    Set rng = Range("A1").CurrentRegion ' top left header cell

    if rng.rows.count > 1 then

    Set rng = rng.Offset(1, 0).Resize(rng.Rows.Count - 1) ' exclude headers

    ActiveWorkbook.Names.Add "Test", rng

    else
    ???
    end if

    ' =COUNTA(Test)

    Regards,
    Peter T

    "GarethP" <GarethP@discussions.microsoft.com> wrote in message
    news:4E046970-45F2-45D4-9457-F4FEDBE53D46@microsoft.com...
    > I am trying to write a macro that will format a spreadsheet (containing

    data
    > downloaded from a Borland database) and perform quartile analysis on

    several
    > data blocks in the spreadsheet. The problem is that size of the data

    blocks
    > varies depending on the original query that was ran on the database, i.e.

    I
    > can't use specific cell references in the macro.
    >
    > The dowloaded data always conforms to a genaral pattern so I've had some
    > success with formatting the worskeet using xlLastCell, xldown, etc to move
    > around the data. Unfortunately I've hit a brick wall with trying to

    include
    > quartile functions in the macro as they require specific cell references

    for
    > both the range of data to analyse and the cell in which the formula result
    > will be displayed.
    >
    > I would be very apprreciative if anyone has any ideas that might help me.
    >
    > Yours hopefully,
    >
    > Gareth Packham
    > Analyst
    > PriceWaterhouseCoopers




+ 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