Vba copy selected cell to last raw

Halim

New Member
Joined
Jan 22, 2015
Messages
25
Hi,

I am developing Vba to copy selected cells (range E8:F8 containging formula) only and paste to last raw in the colum of E:F, upon the data in range A8:D is being updated daily. Appreciate any help on this matter.

Private Sub CommandButton1_Click()
Dim Last_Row As String
Last_Row = Sheet5.Range("E8").End(xlDown).Offset(1).Row
Sheet5.Range("E8:F8").Copy Sheet5.Range("E8" & Last_Row).Paste
End Sub

but I having run-time error "438".
ABCDEF
DateNumberDataDeleted Row***Diff
01-02-1410.475 0.4750.000
02-02-1420.473 0.475-0.002
03-02-1430.477 0.4750.002
04-02-1440.480 0.4750.005
05-02-1450.477 0.4750.002
06-02-1460.476 0.4750.001
07-02-1470.480 0.4750.005
08-02-1480.478 0.4750.003
09-02-1490.474 0.475-0.001
10-02-14100.471 0.475-0.004
11-02-14110.473
12-02-14120.474
13-02-14130.476
14-02-14140.477
15-02-14150.478
16-02-14160.479
17-02-14170.4800.492
18-02-14180.478
10-02-14190.471
11-02-14200.473

<tbody>
</tbody><colgroup><col span="2"><col><col><col><col></colgroup>
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
Hi Hali ... Here you go..
Code:
Dim Last_Row As Integer
Last_Row = Sheet5.Range("E8").End(xlDown).Offset(1).Row
Sheet5.Range("E8:F8").Copy Sheet5.Range("E" & Last_Row)
 
Upvote 0

Forum statistics

Threads
1,214,551
Messages
6,120,156
Members
448,948
Latest member
spamiki

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top