Inserting # of rows depending on value in Column
I have a spreadsheet where I need to insert x number of
rows below the row where the column = "x" For ex. A B C D abc 123 xyz 3 I need excel to insert 3 rows beneath this row. Any help is appreciated, because I'm not having much luck! Thanks! |
Inserting # of rows depending on value in Column
Assume the cell with xyz is selected
x = 3 ActiveCell.offset(1,0).Resize(x,1).EntireRow.Inser t -- Regards, Tom Ogilvy Christel wrote in message ... I have a spreadsheet where I need to insert x number of rows below the row where the column = "x" For ex. A B C D abc 123 xyz 3 I need excel to insert 3 rows beneath this row. Any help is appreciated, because I'm not having much luck! Thanks! |
Inserting # of rows depending on value in Column
Sorry, I should have been more specific. I need to go
through rows 2 to 1000, checking each column 11 for the value that I need to insert that number of rows under. I have this and it "kind of" works, but it inserts the rows in the wrong place. Any more suggestions? Thanks! Sub addrows() Dim intCol As Integer Dim intRow As Integer For intRow = 3 To 1000 intCol = 11 If Worksheets("Master Schedule").Cells(intRow, intCol).Value < "" Then Rowinsert = Value ActiveCell.Offset(1, 0).EntireRow.Insert intRow = intRow + 1 -----Original Message----- Assume the cell with xyz is selected x = 3 ActiveCell.offset(1,0).Resize(x,1).EntireRow.Inse rt -- Regards, Tom Ogilvy Christel wrote in message ... I have a spreadsheet where I need to insert x number of rows below the row where the column = "x" For ex. A B C D abc 123 xyz 3 I need excel to insert 3 rows beneath this row. Any help is appreciated, because I'm not having much luck! Thanks! . |
Inserting # of rows depending on value in Column
I should also mention that Column 11 is a formula that
calculates a number -----Original Message----- Assume the cell with xyz is selected x = 3 ActiveCell.offset(1,0).Resize(x,1).EntireRow.Inse rt -- Regards, Tom Ogilvy Christel wrote in message ... I have a spreadsheet where I need to insert x number of rows below the row where the column = "x" For ex. A B C D abc 123 xyz 3 I need excel to insert 3 rows beneath this row. Any help is appreciated, because I'm not having much luck! Thanks! . |
Inserting # of rows depending on value in Column
Thank you so much! that did the trick! |
All times are GMT +1. The time now is 03:10 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com