ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   insert rows in excel spreadsheet via macro (https://www.excelbanter.com/excel-worksheet-functions/27530-insert-rows-excel-spreadsheet-via-macro.html)

Floyd Elkins

insert rows in excel spreadsheet via macro
 
I need to be able to insert a number into a column in an Excel Spreadsheet
and have that number of rows (copied from another row) entered following that
row.

Bob Phillips

With VBA

ActiveCell.Offset(1, 0).Resize(ActiveCell.Value).EntireRow.Insert


--
HTH

Bob Phillips

"Floyd Elkins" <Floyd wrote in message
...
I need to be able to insert a number into a column in an Excel Spreadsheet
and have that number of rows (copied from another row) entered following

that
row.




Floyd Elkins

Thanks Bob - I really appreciate the prompt response! I need to be able to
go to a specific column (heading = Quantity). Based on the number entered, I
want to enter that number of rows immediately following this entry. I'm not
sure that a Macro is the right way to do this, and I can't find a command
that will do it. Any suggestions?

Thanks again,

Floyd

"Bob Phillips" wrote:

With VBA

ActiveCell.Offset(1, 0).Resize(ActiveCell.Value).EntireRow.Insert


--
HTH

Bob Phillips

"Floyd Elkins" <Floyd wrote in message
...
I need to be able to insert a number into a column in an Excel Spreadsheet
and have that number of rows (copied from another row) entered following

that
row.





Duke Carey

Bob's VBA command does just what you want.

If you are not comfortable with macros/VBA, get a quick tutorial at David
McRitchie's website

http://www.mvps.org/dmcritchie/excel...m#vbatutorials


"Floyd Elkins" wrote:

Thanks Bob - I really appreciate the prompt response! I need to be able to
go to a specific column (heading = Quantity). Based on the number entered, I
want to enter that number of rows immediately following this entry. I'm not
sure that a Macro is the right way to do this, and I can't find a command
that will do it. Any suggestions?

Thanks again,

Floyd

"Bob Phillips" wrote:

With VBA

ActiveCell.Offset(1, 0).Resize(ActiveCell.Value).EntireRow.Insert


--
HTH

Bob Phillips

"Floyd Elkins" <Floyd wrote in message
...
I need to be able to insert a number into a column in an Excel Spreadsheet
and have that number of rows (copied from another row) entered following

that
row.






All times are GMT +1. The time now is 12:14 AM.

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