Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a way I can show in one cell the value of whatever cell is selected?
|
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple cells or columns are selected instead of selected cell or | Excel Discussion (Misc queries) | |||
No color is showing up when cells are selected | Excel Discussion (Misc queries) | |||
Macro to take selected cells times a selected cell | Excel Programming | |||
combo box not showing selected item.. | Excel Programming | |||
Open a window / box showing a selected range of cells only | Excel Programming |