How to apply the resize property to an active cell

myespooir

Board Regular
Joined
Jul 24, 2015
Messages
52
Hi there,

I would like to ask for help on how to resize based on the active cell location.

I need the macro to copy the last 20 rows (Jan) of my existing data to generate the same formulas for the next Month. This is the code I recorded/edited.

Code:
    Range("A2").Select
    Selection.End(xlDown).Select
    ActiveCell.Resize(-21, 6).Select
    ActiveCell.Activate
    Selection.Copy
    Range("A2").Select
    Selection.End(xlDown).Select
    ActiveCell.Offset(1, 0).Range("A1").Select
    ActiveSheet.Paste

However, the problem seems to be that i cannot resize the activecells. Could you let me know how to rewrite the macro?

Thanks a million!

Myespooir
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You can't resize to a negative number. Try this:
Code:
    Range("A2").End(xlDown).offset(-19, 0).Resize(20, 6).Copy Destination:=Range("A2").End(xlDown).Offset(1, 0)
 
Upvote 0

Forum statistics

Threads
1,214,376
Messages
6,119,180
Members
448,871
Latest member
hengshankouniuniu

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