Changing Cell Value

Yogi

Board Regular
I have numerical values in an array of cells (say from A1:A25). As I click on any of these cells in the array I want the value of that particular cell to display in cell D1. When a different cell is selected the display changes in cell D1. Is this possible?

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

Tom Urtis

MrExcel MVP
Sounds like a worksheet selection event may do the trick. Right click on your sheet tab, left click on View Code, and paste this in:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("A1:A25")) Is Nothing Then Range("D1").Value = ""
Range("D1").Value = Target.Value
End Sub

Any help?

Yogi

Board Regular
Mission Accomplished!
Thanks Tom!
On 2002-10-22 20:58, Tom Urtis wrote:
Sounds like a worksheet selection event may do the trick. Right click on your sheet tab, left click on View Code, and paste this in:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Intersect(Target, Range("A1:A25")) Is Nothing Then Range("D1").Value = ""
Range("D1").Value = Target.Value
End Sub

Any help?

[/quote]

Yogi Anand

MrExcel MVP
Hi Yogi:

Welcome to the Board!

Tom Urtis gave you a VBA solution -- that may be a lot neater -- I am going to submit a non-vaba solution, a formula to be input in cell D1 ...

=IF(AND(CELL("col")=1,CELL("row")>=1,CELL("row")<26),CELL("contents"),"")

Regards!
(have we both not got an interesting first name)
Yogi Anand

Replies
10
Views
643
Replies
3
Views
270
Replies
17
Views
2K
Replies
5
Views
236
Replies
0
Views
216

1,181,449
Messages
5,929,978
Members
436,711
Latest member

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back