Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Showing selected cell value

Is there a way I can show in one cell the value of whatever cell is selected?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Showing selected cell value

Hi Misssy

You can use the SelectionChange event

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Range("A1").Value = Target.Value
End Sub

Read more about events on Chip Pearson's site.
http://www.cpearson.com/excel/events.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Misssy" wrote in message ...
Is there a way I can show in one cell the value of whatever cell is selected?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Showing selected cell value

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Range("H1").Value = Target.Value
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Misssy" wrote in message
...
Is there a way I can show in one cell the value of whatever cell is

selected?


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default Showing selected cell value

In the sheet module, say you want the value to be displayed in cell A1:
'----------------------------------------------------
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
With Range("A1")
.Value = ActiveCell.Value
.NumberFormat = ActiveCell.NumberFormat
End With
End Sub
'---------------------------------------------------
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Misssy" wrote:

Is there a way I can show in one cell the value of whatever cell is selected?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Showing selected cell value

Thanks - All options work great!

"Bob Phillips" wrote:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Me.Range("H1").Value = Target.Value
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Misssy" wrote in message
...
Is there a way I can show in one cell the value of whatever cell is

selected?



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
Multiple cells or columns are selected instead of selected cell or Mikey Excel Discussion (Misc queries) 1 April 29th 09 09:48 PM
No color is showing up when cells are selected Carol-Ann Excel Discussion (Misc queries) 1 November 25th 08 06:32 AM
Macro to take selected cells times a selected cell Craig Excel Programming 4 October 24th 05 12:54 AM
combo box not showing selected item.. nycdon Excel Programming 1 August 17th 05 06:28 PM
Open a window / box showing a selected range of cells only jennie Excel Programming 2 April 30th 04 02:32 PM


All times are GMT +1. The time now is 02:49 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"