Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Row
Working in Excel 2007, I have a column (B) that when the number changes I
want a macro to insert a row... Approx 16K rows that need to be evaluated. Example Desired Result 2333 2333 2333 2333 2333 2333 2335 2335 TFTH, Tom |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Row
By coincidence I have a utility macro I wrote to do just that. To use
it, go to the bottom of the list and after the last cell enter the word "stop" (without quotes) in that cell. Then place the cell pointer at the top of the list and run this code. Sub InsertRow() With Application .Calculation = xlManual .MaxChange = 0.001 End With ActiveWorkbook.PrecisionAsDisplayed = False Dim A, B Do Until ActiveCell.Value = "stop" A = ActiveCell.Value ActiveCell.Offset(1, 0).Select B = ActiveCell.Value If A < B Then Selection.EntireRow.Insert ActiveCell.Offset(1, 0).Select End If Loop With Application .Calculation = xlAutomatic .MaxChange = 0.001 End With ActiveWorkbook.PrecisionAsDisplayed = False Calculate End Sub |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Insert Row
Dave,
Works like a charm!!! Thanks... Tom "Dave O" wrote: By coincidence I have a utility macro I wrote to do just that. To use it, go to the bottom of the list and after the last cell enter the word "stop" (without quotes) in that cell. Then place the cell pointer at the top of the list and run this code. Sub InsertRow() With Application .Calculation = xlManual .MaxChange = 0.001 End With ActiveWorkbook.PrecisionAsDisplayed = False Dim A, B Do Until ActiveCell.Value = "stop" A = ActiveCell.Value ActiveCell.Offset(1, 0).Select B = ActiveCell.Value If A < B Then Selection.EntireRow.Insert ActiveCell.Offset(1, 0).Select End If Loop With Application .Calculation = xlAutomatic .MaxChange = 0.001 End With ActiveWorkbook.PrecisionAsDisplayed = False Calculate End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
SQL Server -- Bulk Insert from Excel to SQL Server | Excel Discussion (Misc queries) | |||
Changing the Insert Row / Column Default | Excel Discussion (Misc queries) | |||
Can I auto insert a worksheet when I insert a value in a cell. | Excel Worksheet Functions | |||
insert picture | Excel Discussion (Misc queries) | |||
Challenging Charting | Charts and Charting in Excel |