Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Emlou85 via OfficeKB.com
 
Posts: n/a
Default A formula for displaying the cell reference of the selected cell

I have drawn a keyboard in excel (B1 is note C, C2 is note D etc). The user
is told to click on the note
E. I then have an If statement that says if cell A2 displays D1 (ie note E)
then to say 'well done that is correct' and if not then display 'wrong have
another go'. My problem is getting a formula in A2 which displays what has
been selected, so the If statement can work!

Emma

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200603/1
  #2   Report Post  
Posted to microsoft.public.excel.misc
Ken Johnson
 
Posts: n/a
Default A formula for displaying the cell reference of the selected cell

Hi Emma,
as far as I know there isn't a formula that will place the selected
cell's value into A1.
However, if you copy the code below, then right click that worksheet's
Sheet Tab a popup contextual menu appears.
Select "View Code" then paste the copied code into the Sheet's code
module, which is the large white space just below the headings
"(General)" on the left and "(Declarations)" on the right.
Then go Alt + F11 to get back to the worksheet.
Every time you select a different cell on hat sheet the code is run and
the value in A1 will be the value in the selected cell.

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Cells(1, 1) = Target.Value
End Sub

Ken Johnson

  #3   Report Post  
Posted to microsoft.public.excel.misc
Trevor Shuttleworth
 
Posts: n/a
Default A formula for displaying the cell reference of the selected cell

Emma

I think you will have to use a macro. Assuming the keyboard is in Sheet 1,
the Sheet 1 Class Module needs the following Selection Change code:

' Sheet 1 Class Module
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Range("A2") = Target.Address(False, False)
Application.EnableEvents = True
End Sub

Whenever a cell is selected, its address will be put into cell A2

Regards

Trevor


"Emlou85 via OfficeKB.com" <u19317@uwe wrote in message
news:5d73183e22541@uwe...
I have drawn a keyboard in excel (B1 is note C, C2 is note D etc). The
user
is told to click on the note
E. I then have an If statement that says if cell A2 displays D1 (ie note
E)
then to say 'well done that is correct' and if not then display 'wrong
have
another go'. My problem is getting a formula in A2 which displays what
has
been selected, so the If statement can work!

Emma

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200603/1



  #4   Report Post  
Posted to microsoft.public.excel.misc
Emlou85 via OfficeKB.com
 
Posts: n/a
Default A formula for displaying the cell reference of the selected cell

Thank you very much for your help!

Emma

Trevor Shuttleworth wrote:
Emma

I think you will have to use a macro. Assuming the keyboard is in Sheet 1,
the Sheet 1 Class Module needs the following Selection Change code:

' Sheet 1 Class Module
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.EnableEvents = False
Range("A2") = Target.Address(False, False)
Application.EnableEvents = True
End Sub

Whenever a cell is selected, its address will be put into cell A2

Regards

Trevor

I have drawn a keyboard in excel (B1 is note C, C2 is note D etc). The
user

[quoted text clipped - 8 lines]

Emma


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200603/1
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Maintaining cell reference after sorting GRITS Excel Discussion (Misc queries) 2 April 30th 23 07:42 PM
Display the cell reference of the cell that is currently selected. Emlou85 via OfficeKB.com Excel Worksheet Functions 5 March 18th 06 10:29 AM
Function/ formula to output a cell reference Creator Excel Worksheet Functions 19 February 17th 06 06:39 PM
How do I leave formula cell blank if 2nd reference cell is empty? Liana S Excel Discussion (Misc queries) 2 October 21st 05 04:38 PM
copied formula has correct cell reference, but result of original lvito Excel Worksheet Functions 1 October 14th 05 04:37 PM


All times are GMT +1. The time now is 04:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"