Change event help

J

Jimbola

Hi there,

I want to create a change event macro that when a change
is made to the first 2 cells in a row, a formula is copied
from the very first row into the next 5 cells of the row
where the change was made.
Hope the layout below makes sense, f1 - f5 represent
formulas.

a b c d e f g
1 Name Rate f1 f2 f3 f4 f5

..
..
..
30 john 12.50 (copy formulas f1 - f5 down here on
change)

Any help would be grately appreciated.

Regards
J
 
T

Tom Ogilvy

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
On Error GoTo ErrHandler
If Target.Column = 1 Or Target.Column = 2 Then
Application.EnableEvents = False
set rng = Cells(1, 3).Resize(1, 5)
rng.copy cells(Target.row,3)
End If
ErrHandler:
Application.EnableEvents = True
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Change event macro 2
Help repeating formulas with skips 1
Macro Help Please 5
Run time 1004 5
Help With Code:Arabic Number to Text 3
Get rid of need for F2.Select 3
Crosstab query 1
Inaccurate count with code 6

Top