Macro VBA Code to Insert New Row and Copy Formula and Value from above row

manish2387

New Member
Joined
Sep 6, 2017
Messages
1
Hello Gurus, I need your help.

I want to write a simple macro code which will do following

1) It will insert an empty row below the active row
2) It will copy selected formula and/or value from above row for specified columns.

Can you help me send macro code for this case?

Thanks you
Manish
 

Some videos you may like

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
16,838
Office Version
2010
Platform
Windows
Code:
Sub InsertAndCopy()
With Selection
       .Offset(1, 0).Insert shift:=xlDown
       .Resize(2, .Columns.Count).FillDown
End With
End Sub
 

aljazd

New Member
Joined
Mar 18, 2020
Messages
1
Office Version
365
Platform
Windows
Hey everyone,
how would the code look if I only wanted to copy the formula but not the value?
Thank you for your reply in advance!
 

Watch MrExcel Video

Forum statistics

Threads
1,099,328
Messages
5,467,970
Members
406,561
Latest member
Grappledog

This Week's Hot Topics

Top