one click selection

C.S.

Board Regular
Joined
Nov 20, 2008
Messages
89
If I have a worksheet with a range of cells (ex. A1:G10) containing dates, is there any way I can setup the worksheet to return the value whatever cell I click on (one click or double click) to another specified cell? Example: Say I've designated F1 to be the cell I want the selected value to return to. I click on cell A1 (which contains 1/1/2010) it will return that value to cell F1.

Is this possible? I'm imagining something similar to a "little hand" selection icon.

Also, if so, can this be done without using macros. And if not, will the macro be usable in both excel 2003 and 2007?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
1. No, can't be done without Macros
2. Yes, this will work in 2003 and 2007

I designated J1.
It didn't make sense to me for the designated cell(F1) to be within the target range A1:G10

Right click the sheet tab, click View code
Paste the following

Code:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, Range("A1:G10")) Is Nothing Then
    Range("J1").Value = Target.Value
End If
End Sub
 
Upvote 0
Try

Code:
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
If Target.Column = 1 Then
    Cancel = True
    Target.Offset(, 5).Value = Target.Value
End If
End Sub
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,729
Members
449,049
Latest member
MiguekHeka

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top