ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cell selection (https://www.excelbanter.com/excel-programming/334318-cell-selection.html)

ronreggin

cell selection
 
Is there a way for me to select a cell and then have the information in
another cell change values?

i.e.
I select cell E1 by clicking on the cell with my mouse. I would like the
information in cell A15 to change to a stored value in another cell, G5.

Is this possible?

Matt Lunn[_3_]

cell selection
 
You could use this code in the Worksheet_SelectionChange event.

If Target.Address = ("$E$1") Then Range("A15").Value = Range("G5").Value

You can access this by right clicking on the worksheet in question and
choosing view code.

Change the drop down box showing General to Worksheet and the
SelectionChange event should automatically appear.

Cheers,
Matt

"ronreggin" wrote:

Is there a way for me to select a cell and then have the information in
another cell change values?

i.e.
I select cell E1 by clicking on the cell with my mouse. I would like the
information in cell A15 to change to a stored value in another cell, G5.

Is this possible?


STEVE BELL

cell selection
 
One way is with a worksheet selection change event.
Put the code in the worksheet module

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$E$1" Then
Range("A15") = Range("G5")
End If
End Sub


--
steveB

Remove "AYN" from email to respond
"ronreggin" wrote in message
...
Is there a way for me to select a cell and then have the information in
another cell change values?

i.e.
I select cell E1 by clicking on the cell with my mouse. I would like the
information in cell A15 to change to a stored value in another cell, G5.

Is this possible?





All times are GMT +1. The time now is 11:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com