automatically copy cell

  • Thread starter Thread starter Excel
  • Start date Start date
E

Excel

Hi,
Is it possible to enter data into for example cell D3 and have excel put the
same data automatically into D25.
Does anyone have a formula for this please.
Thank you
 
Right click sheet tab>view code>insert this

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 4 Then Exit Sub
Target.Offset(22) = Target
End Sub
 
Sorry to seem stupid but I have entered what you said but how do I implement
it....make it work?

Thank you
 
ok, got to work, I did not have macros enabled.

the target offset is 4 but how can I get it to target another column instead
of the 22nd row in the same column?

Thank you

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 4 Then Exit Sub
Target.Offset(22) = Target
End Sub
 
He had better turn off events or he will end up filling every 22nd cell in
column D with values.


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 4 Then Exit Sub
Application.EnableEvents = False
Target.Offset(22) = Target
Application.EnableEvents = True
End Sub


Better yet, limit the event to row 3 or even just D3.
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$D$3" Then Exit Sub
Application.EnableEvents = False
Target.Offset(22) = Target
Application.EnableEvents = True
End Sub



Bernie
 
Hi,
Yes, I just found that out....every 22nd cell full.

How do I get the values to stay in the same row but a different column, say
D2's value is put into Q2

Thank you
 
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$D$2" Then Exit Sub
'If Target.Row <> 2 Then Exit Sub 'To limit to a specific row
'If Target.Column <> 4 Then Exit Sub 'To limit to a specific column

Application.EnableEvents = False

'Chose one of these three lines:
Range("Q2").Value = Range("D2").Value 'Specific Cells
Target(1,14).Value = Target.Value 'Indexing
Target.Offset(0,13).Value = Target.Value 'Using Offset

Application.EnableEvents = True
End Sub

Bernie
 
Thanks, the one below worked for 1 row but how can I get it to work for
every row

Thank you

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address <> "$D$2" Then Exit Sub
'If Target.Row <> 2 Then Exit Sub 'To limit to a specific row
'If Target.Column <> 4 Then Exit Sub 'To limit to a specific column

Application.EnableEvents = False

Range("Q2").Value = Range("D2").Value 'Specific Cells

Application.EnableEvents = True
End Sub
 
Every row in column D?

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column <> 4 Then Exit Sub 'To limit to column D
Application.EnableEvents = False
Target.Offset(0,13).Value = Target.Value 'Using Offset
Application.EnableEvents = True
End Sub

Bernie
 
Back
Top