Is there a way I can show in one cell the value of whatever cell is selected?
Is there a way I can show in one cell the value of whatever cell is selected?
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" <Misssy@discussions.microsoft.com> wrote in message news:56271CEF-182C-473B-80A3-B14BB23832E5@microsoft.com...
> Is there a way I can show in one cell the value of whatever cell is selected?
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" <Misssy@discussions.microsoft.com> wrote in message
news:56271CEF-182C-473B-80A3-B14BB23832E5@microsoft.com...
> Is there a way I can show in one cell the value of whatever cell is
selected?
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?
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" <Misssy@discussions.microsoft.com> wrote in message
> news:56271CEF-182C-473B-80A3-B14BB23832E5@microsoft.com...
> > Is there a way I can show in one cell the value of whatever cell is
> selected?
>
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks