Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
I have a large spreadsheet (approx. 8500 rows) with four columns.
I would like to insert a new row below any row where there is a value (entry) in row D. It is as simple as that, but I can't figure out how to do it... Thanks |
#2
![]() |
|||
|
|||
![]()
David,
This is a one-time thing. If you run it again, you'll get another empty row after any cell in column D that isn't empty. Keep an extra copy of your sheet, or don't save the file if it messes up. Dim ColumnD As Range Dim MyCell As Range Set ColumnD = Intersect(Range("D:D"), ActiveSheet.UsedRange) For Each MyCell In ColumnD If MyCell.Value < "" Then ' is it empty? MyCell.Offset(1, 0).EntireRow.Insert Shift:=xlShiftDown ' insert row after End If Next MyCell -- Earl Kiosterud www.smokeylake.com/ ------------------------------------------- "David B" <David wrote in message ... I have a large spreadsheet (approx. 8500 rows) with four columns. I would like to insert a new row below any row where there is a value (entry) in row D. It is as simple as that, but I can't figure out how to do it... Thanks |
#3
![]() |
|||
|
|||
![]()
Worked like a charm Earl.
Thanks so much! Bless you "Earl Kiosterud" wrote: David, This is a one-time thing. If you run it again, you'll get another empty row after any cell in column D that isn't empty. Keep an extra copy of your sheet, or don't save the file if it messes up. Dim ColumnD As Range Dim MyCell As Range Set ColumnD = Intersect(Range("D:D"), ActiveSheet.UsedRange) For Each MyCell In ColumnD If MyCell.Value < "" Then ' is it empty? MyCell.Offset(1, 0).EntireRow.Insert Shift:=xlShiftDown ' insert row after End If Next MyCell -- Earl Kiosterud www.smokeylake.com/ ------------------------------------------- "David B" <David wrote in message ... I have a large spreadsheet (approx. 8500 rows) with four columns. I would like to insert a new row below any row where there is a value (entry) in row D. It is as simple as that, but I can't figure out how to do it... Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Lookup Table Dilemma | Excel Worksheet Functions | |||
how do i insert words into a column without erasing the words | Excel Discussion (Misc queries) | |||
How to group similar column titles together???? | Excel Discussion (Misc queries) | |||
Lookup then Match and insert value from next column | Excel Worksheet Functions | |||
Challenging Charting | Charts and Charting in Excel |