![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Apr 2002
Posts: 28
|
Does anyone know of how to automatically have a cell copy another cell based on the original cell's value? For example, if a cell has a value of 8, I would like the cell (value and all properties of the cell specifically any comments that are in the original cell) copied to another specific cell? Is this possible?
Thanks all. |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Feb 2002
Location: Perth Australia
Posts: 1,567
|
Hi electronicsgeek
Try this event macro Right click sheet tab, left click View Code and paste in this code Private Sub Worksheet_Change(ByVal Target As Range) If Target.Address = "$A$1" Then If Target.Value = 8 Then Target.Copy Range("D5").Select ActiveSheet.Paste Application.CutCopyMode = False End If End If End Sub When 8 is entered into A1 it copies that cell to D5 Hope this helps regards Derek [ This Message was edited by: Derek on 2002-04-06 22:43 ] |
|
|
|
|
|
#3 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
Hi Electronicsgeek
Derek may have already kindly answered yor question, but you could also use: Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A" And Target = 8 Then
Target.Copy Destination:=Range("D5")
End If
End Sub
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|