ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Which cell did I click? (https://www.excelbanter.com/excel-programming/319962-cell-did-i-click.html)

Ian Bayly[_2_]

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



Ian Bayly[_2_]

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" wrote in message
...
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





Tom Ogilvy

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" wrote in message
...
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" wrote in message
...
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








All times are GMT +1. The time now is 02:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com