ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inserting rows and saving formulas (https://www.excelbanter.com/excel-programming/296991-inserting-rows-saving-formulas.html)

Shawna[_2_]

Inserting rows and saving formulas
 
Hi,

I am using the code below to INSERT rows in an invoice sheet, but it doesn't copy the formulas. Is
there a way to do insert a row and copy the formulas, too? Not the values, just the formulas.

In the code snippet "intRowCount" is the current row number - a count of the line items.

Range("A" & intRowCount).EntireRow.Select
Selection.EntireRow.Insert shift:=xlShiftDown
Range("A" & intRowCount).Select

Thank you,

Shawna Brooks

Frank Kabel

Inserting rows and saving formulas
 
Hi
have a look at
http://www.mvps.org/dmcritchie/excel/insrtrow.htm

--
Regards
Frank Kabel
Frankfurt, Germany


Shawna wrote:
Hi,

I am using the code below to INSERT rows in an invoice sheet, but it
doesn't copy the formulas. Is there a way to do insert a row and
copy the formulas, too? Not the values, just the formulas.

In the code snippet "intRowCount" is the current row number - a count
of the line items.

Range("A" & intRowCount).EntireRow.Select
Selection.EntireRow.Insert shift:=xlShiftDown
Range("A" & intRowCount).Select

Thank you,

Shawna Brooks




All times are GMT +1. The time now is 03:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com