Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have this VBA code to insert a line in a spreadsheet everytime a values
changes. How can I get a heading entered in column E of the inserted line.I thought it would be relatively easy but obviously not. col = ActiveCell.Column lastrow = Cells(Rows.Count, col).End(xlUp).Row If IsEmpty(Cells(1, col).Value) Then firstrow = Cells(1, col).End(xlDown).Row Else firstrow = 1 End If Set cell = Cells(lastrow, col) While cell.Row firstrow + 6 If cell.Value < cell.Offset(-1, 0).Value Then cell.EntireRow.Insert Set cell = cell.Offset(-2, 0) Else Set cell = cell.Offset(-1, 0) End If Wend Many thanks Dave |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how can I exclude a heading but show that heading in sheet. | Excel Discussion (Misc queries) | |||
In a table produce an value by column heading and row heading | Excel Worksheet Functions | |||
AUTO INSERT PAGE BREAK FOR EACH COPIED HEADING | Excel Discussion (Misc queries) | |||
Can one insert a variable/cell ref. in the heading | Excel Discussion (Misc queries) | |||
How do I insert a heading into a column | Excel Worksheet Functions |