+ Reply to Thread
Results 1 to 3 of 3

Which cell did I click?

  1. #1
    Ian Bayly
    Guest

    Which cell did I click?

    Very basic question because I don't know much excel code. The question seems
    too basic even for the help file!
    I have a VB project where I create a spreadsheet and populate 8 columns and
    approx 100 rows.
    I want to click on any row in column 1 and then get the value of column 8 in
    the same row.
    Column 1 is a location name, column 8 is a pointer to an rtf file and I
    wish to click on the name and open the rtf file in word.
    I have no problem with handling the rtf file I just don't know how to return
    the location of the cell which I click.

    TIA

    Ian B



  2. #2
    Ian Bayly
    Guest

    Re: Which cell did I click?

    I think the following did it for me!
    Still welcome any more robust way of doing same.

    Dim myRange As Range
    Worksheets("Sheet1").Activate
    Set myRange = Selection
    MsgBox myRange.Address

    Tks
    "Ian Bayly" <[email protected]> wrote in message
    news:O%[email protected]...
    > Very basic question because I don't know much excel code. The question

    seems
    > too basic even for the help file!
    > I have a VB project where I create a spreadsheet and populate 8 columns

    and
    > approx 100 rows.
    > I want to click on any row in column 1 and then get the value of column 8

    in
    > the same row.
    > Column 1 is a location name, column 8 is a pointer to an rtf file and I
    > wish to click on the name and open the rtf file in word.
    > I have no problem with handling the rtf file I just don't know how to

    return
    > the location of the cell which I click.
    >
    > TIA
    >
    > Ian B
    >
    >




  3. #3
    Tom Ogilvy
    Guest

    Re: Which cell did I click?

    Not sure how that helps unless you are going to parse the row out of it, but

    cells(selection(1).row,8).Value

    would return the value in the 8th column in the first row of the selection.

    --
    Regards,
    Tom Ogilvy

    "Ian Bayly" <[email protected]> wrote in message
    news:[email protected]...
    > I think the following did it for me!
    > Still welcome any more robust way of doing same.
    >
    > Dim myRange As Range
    > Worksheets("Sheet1").Activate
    > Set myRange = Selection
    > MsgBox myRange.Address
    >
    > Tks
    > "Ian Bayly" <[email protected]> wrote in message
    > news:O%[email protected]...
    > > Very basic question because I don't know much excel code. The question

    > seems
    > > too basic even for the help file!
    > > I have a VB project where I create a spreadsheet and populate 8 columns

    > and
    > > approx 100 rows.
    > > I want to click on any row in column 1 and then get the value of column

    8
    > in
    > > the same row.
    > > Column 1 is a location name, column 8 is a pointer to an rtf file and I
    > > wish to click on the name and open the rtf file in word.
    > > I have no problem with handling the rtf file I just don't know how to

    > return
    > > the location of the cell which I click.
    > >
    > > TIA
    > >
    > > Ian B
    > >
    > >

    >
    >




+ 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