Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
AJPendragon
 
Posts: n/a
Default Current cell position

I want to have a cell that shows the current position of the selected cell.

So if the formula was in A1 and the current cell selected was B21 - I want
A1 to show "B21" - is this possible?

Thanks

Andrew
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ron Rosenfeld
 
Posts: n/a
Default Current cell position

On Fri, 3 Feb 2006 08:07:58 -0800, "AJPendragon"
wrote:

I want to have a cell that shows the current position of the selected cell.

So if the formula was in A1 and the current cell selected was B21 - I want
A1 to show "B21" - is this possible?

Thanks

Andrew



The problem with doing this by formula is that formulas only update on a
calculation event; and change the cell selection does not ordinarily do that.

You could "force" that to happen, but then you'd be doing a calculation
everytime you moved the cursor and selected a new cell -- that would really
slow down work on your workbook unless it were extremely simple.

You could display the selected range in A1 with a simple event-triggered
(selection change) macro.

If you did not want to hard-wire that to A1 (or some other specific cell), you
could also have the macro check a different cell in which you stored the
address where you wanted the selected cell address displayed.

To enter this code, right click the sheet tab and select View Code from that
menu. Then paste the code below into the window that opens.

1. To show always in A1:

====================
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
[a1] = Selection.Address
End Sub
====================

2. To show in the address found in A1

================================
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
Range([a1].Text) = Selection.Address
End Sub
==================================

--ron
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
Excel formula to find position of the contents of a cell within a column. [email protected] Excel Discussion (Misc queries) 3 September 26th 05 03:52 PM
Why does cursor move position in a cell I'm trying to edit? BrendaK Excel Discussion (Misc queries) 3 August 22nd 05 10:32 PM
Cell color based upon cell value My View Excel Discussion (Misc queries) 11 July 6th 05 03:59 AM
cell color index comparison MINAL ZUNKE New Users to Excel 1 June 30th 05 07:11 AM
sum and current cell value Kim via OfficeKB.com Excel Worksheet Functions 1 March 3rd 05 02:56 AM


All times are GMT +1. The time now is 12:47 PM.

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"