+ Reply to Thread
Results 1 to 5 of 5

Finding the right most cell as a function

  1. #1
    Andrew
    Guest

    Finding the right most cell as a function

    Ladies & Gents,

    I'm using a spread sheet which has many rows of information, with multiple
    start & finishing columns. Can anyone help me with a function that can
    return the first & last values of each row?


    TIA

    Andrew Sbrana



  2. #2
    Andrew
    Guest

    Finding the right most cell as a function (oops! I forgot)

    Ladies & Gents,

    I'm using a spreadsheet which has many rows of information, with multiple
    start & finishing columns. Can anyone help me with a function that can
    return the first & last values of each row?

    I forgot to mention that I'm using Excel 97 to create the spreadsheet
    mentioned.


    TIA

    Andrew Sbrana




  3. #3
    gocush
    Guest

    RE: Finding the right most cell as a function (oops! I forgot)

    If you can select a cell in each row then:

    Selection.End(xlToLeft).value

    or (xlToRight)

    should get you started


    "Andrew" wrote:

    > Ladies & Gents,
    >
    > I'm using a spreadsheet which has many rows of information, with multiple
    > start & finishing columns. Can anyone help me with a function that can
    > return the first & last values of each row?
    >
    > I forgot to mention that I'm using Excel 97 to create the spreadsheet
    > mentioned.
    >
    >
    > TIA
    >
    > Andrew Sbrana
    >
    >
    >
    >


  4. #4
    Edwin Tam
    Guest

    Re: Finding the right most cell as a function

    Your question is unclear and I cannot give a complete answer.

    1) What did you meant by "has multiple start & finish columns"? Every row's
    start column and finish column may be different?

    2) If you got the custom functions, where will you enter those functions?
    Will they be entered in the same column on the right-hand-side, or adjacent
    to the last column of each row?

    The optimal case will be:
    1) All row start in column A
    2) The formulas are entered on the right-hand-side of each row, and there is
    always one empty cell between the right-most cell and the formula. (Because
    if there is no empty cell, the formulas will become the last and second-last
    columns!!)

    The follow macros may give you some hint of the basic strategy to solve the
    problem:

    Function firstcell()
    firstcell = _
    Application.Caller.Parent.Rows(Application.Caller.Row). _
    Cells(1).Value
    End Function

    Function lastcell()
    lastcell = _
    Application.Caller.Parent.Rows(Application.Caller.Row). _
    Cells(1).End(xlToRight).Value
    End Function



    Regards,
    Edwin Tam
    [email protected]
    http://www.vonixx.com



    On 1/11/05 6:36 AM, in article [email protected],
    "Andrew" <[email protected]> wrote:

    > Ladies & Gents,
    >
    > I'm using a spread sheet which has many rows of information, with multiple
    > start & finishing columns. Can anyone help me with a function that can
    > return the first & last values of each row?
    >
    >
    > TIA
    >
    > Andrew Sbrana
    >
    >



  5. #5
    Andrew
    Guest

    Re: Finding the right most cell as a function

    Edwin,

    We've had a look at your functions, and are able to adapt them to our
    requirements.


    Thanks for your help


    Andrew

    Edwin Tam wrote in message ...
    Your question is unclear and I cannot give a complete answer.

    1) What did you meant by "has multiple start & finish columns"? Every row's
    start column and finish column may be different?

    2) If you got the custom functions, where will you enter those functions?
    Will they be entered in the same column on the right-hand-side, or adjacent
    to the last column of each row?

    The optimal case will be:
    1) All row start in column A
    2) The formulas are entered on the right-hand-side of each row, and there is
    always one empty cell between the right-most cell and the formula. (Because
    if there is no empty cell, the formulas will become the last and second-last
    columns!!)

    The follow macros may give you some hint of the basic strategy to solve the
    problem:

    Function firstcell()
    firstcell = _
    Application.Caller.Parent.Rows(Application.Caller.Row). _
    Cells(1).Value
    End Function

    Function lastcell()
    lastcell = _
    Application.Caller.Parent.Rows(Application.Caller.Row). _
    Cells(1).End(xlToRight).Value
    End Function



    Regards,
    Edwin Tam
    [email protected]
    http://www.vonixx.com



    On 1/11/05 6:36 AM, in article [email protected],
    "Andrew" <[email protected]> wrote:

    > Ladies & Gents,
    >
    > I'm using a spread sheet which has many rows of information, with multiple
    > start & finishing columns. Can anyone help me with a function that can
    > return the first & last values of each row?
    >
    >
    > TIA
    >
    > Andrew Sbrana
    >
    >




+ 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