ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro that inserts rows and copy values (https://www.excelbanter.com/excel-programming/273957-macro-inserts-rows-copy-values.html)

Emece[_2_]

Macro that inserts rows and copy values
 
I want to design a macro so as to do the following thing:
Insert a row.
Copy the value that is in a cell of the immediate before
row.
Copy this value in the row inserted.

I want the macro to repeat this in the whole workbook.

I know it is a simple one, but I can't figure it out
correctly.

Thanks a lot


David McRitchie[_2_]

Macro that inserts rows and copy values
 
Don't know what you mean by repeat in another workbook.
If you mean available in any workbook then install the
macro in your personal.xls
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Inserting a row and copying values (and not formulas) see
http://www.mvps.org/dmcritchie/excel/insrtrow.htm

if you want to keep constants as well as the values then delete the
following in a copy of the macro:

' to remove the non-formulas -- 1998/03/11 Bill Manville
Selection.Offset(1).Resize(vRows).EntireRow. _
SpecialCells(xlConstants).ClearContents

--
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Emece" wrote in message ...
I want to design a macro so as to do the following thing:
Insert a row.
Copy the value that is in a cell of the immediate before
row.
Copy this value in the row inserted.

I want the macro to repeat this in the whole workbook.

I know it is a simple one, but I can't figure it out
correctly.

Thanks a lot





All times are GMT +1. The time now is 01:26 PM.

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