ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Inserting Multiple Rows into Spreadsheet (https://www.excelbanter.com/excel-discussion-misc-queries/223912-inserting-multiple-rows-into-spreadsheet.html)

Auburn Jon

Inserting Multiple Rows into Spreadsheet
 
I have several spreadsheets of 14,000-15,000 lines each that need rows added
at intervals determined by an ID code in column A. The number of rows of
data varies from 7 to 24. The macros I've seen posted deal with a more fixed
interval. Can this be modified to essentially add rows at random, or is
there another possibility?

Thanks for any Info

joel

Inserting Multiple Rows into Spreadsheet
 
Rows can be added with a macro by looking at data on the worksheet to
determine where rows ae added.

Sub AddRows()

IDNum = 123
LastRow = Range("A" & Rows.Count).end(xlup).Row
for RowCount = LastRow to 1 step -1
if Range("A" & RowCount) = IDNum then
Rows(RowCount + 1).Insert
end if
next RowCount

End Sub

"Auburn Jon" wrote:

I have several spreadsheets of 14,000-15,000 lines each that need rows added
at intervals determined by an ID code in column A. The number of rows of
data varies from 7 to 24. The macros I've seen posted deal with a more fixed
interval. Can this be modified to essentially add rows at random, or is
there another possibility?

Thanks for any Info



All times are GMT +1. The time now is 06:25 AM.

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