Adding new numbers in last row

S

SMILE

Hi everyone
I want to run a macro to do the following.
When I run the macro, it should increase a row and record th
following. Let me explain.

In cell A1 the value is 1 , in B1 value of $F$10 In C1 value of $G$1
(In B1 & C1 it should do copy- paste value from F10 & G10)

when I run the macro the following to be recorded automatically.
In A2=A1+1, in B2 paste value of $F$10 In C2 paste value of $G$10

When I run the macro next time it should record in ROW#3 like

In A3=A2+1, in B3 paste value of $F$10 In C3 paste value of $G$10


Same time in $H$10 always the value in the last row of A to be copied
(in $H$10=last row of A)

Hope someone will help me to do this.

Thanks in advance
Tom
 
J

JE McGimpsey

One way:

Public Sub CopyValues()
With Range("A" & Rows.Count).End(xlUp).Offset(1, 0)
.Value = .Offset(-1, 0).Value + 1
.Offset(0, 1).Resize(1, 2).Value = Range("F10:G10").Value
Range("H10").Value = .Value
End With
End Sub
 
Top