LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,058
Default excel: if selected, copy cell from corresponding row

Assume the source sheet is "Sheet1".
Assume the destination sheet is "Sheet2", the destination cell is B9.

Put the following macro in the "Sheet1" worksheet code area:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim s1 As Worksheet
Dim s2 As Worksheet
Dim r1 As Range, r2 As Range
Set s1 = Sheets("Sheet1")
Set s2 = Sheets("Sheet2")
Set r1 = s1.Range("A:A")
Set r2 = s2.Range("B9")
If Intersect(Target, r1) Is Nothing Then Exit Sub
Target.Offset(0, 3).Copy r2
End Sub

Whenever a cell in column A is selected, the equivalent cell in column D is
copied to the destination cell in the other worksheet.

REMEMBER: the worksheet code area, not a standard module.
--
Gary''s Student - gsnu200748


"davey-in-the-navy" wrote:

is it possible to make a formula (or macro) so if a cell from column "A" is
selected, then a cell from that same row will be copied to another sheet?
example:
A3 in sheet 1 is selected, D3 from sheet 1 is automaticly copied to wherever
specified in sheet 2
I would like to set it up so only 1 cell in column A can be selected at a
time.

I greatly appreciate any help.

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How I can copy / paste a selected cells to other columns in Excel M.Rafat Excel Discussion (Misc queries) 4 November 7th 06 05:42 AM
auto copy only selected cells Keith Crooks Excel Worksheet Functions 1 February 25th 06 09:42 PM
Copy selected lines WTG Excel Worksheet Functions 9 February 17th 06 02:45 AM
how read value from last selected cell? It is possible? how get adress last selected cell? Andrzej New Users to Excel 4 May 30th 05 07:28 PM
How do I tell Excel to take a selected item and copy it to anothe. HEATHERCOX Excel Worksheet Functions 0 February 28th 05 03:27 PM


All times are GMT +1. The time now is 09:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"