Home |
Search |
Today's Posts |
#1
|
|||
|
|||
how do I insert a row based on a function result
I want to run a a IF statement to qualify a row of data, and them if the
condition is true, I want to insert a blank row below the current row where the fomula resides. I could also rework the formula to allow for the insertion of the blank row to be above the current row, as well. Either would work. Any assistance would be great! |
#2
|
|||
|
|||
Formulas can return values to the cell--they can't insert rows above (or below).
chris wrote: I want to run a a IF statement to qualify a row of data, and them if the condition is true, I want to insert a blank row below the current row where the fomula resides. I could also rework the formula to allow for the insertion of the blank row to be above the current row, as well. Either would work. Any assistance would be great! -- Dave Peterson |
#3
|
|||
|
|||
"Dave Peterson" wrote: Formulas can return values to the cell--they can't insert rows above (or below). chris wrote: I want to run a a IF statement to qualify a row of data, and them if the condition is true, I want to insert a blank row below the current row where the fomula resides. I could also rework the formula to allow for the insertion of the blank row to be above the current row, as well. Either would work. Any assistance would be great! -- Dave Peterson I understand. Then, is there a way to insert a blank row from a Macro.. one that would look at a one consistent cell within a row to qualify the insertion (ie...for any row where column A contains "X", then insert a row?? Thanks. |
#4
|
|||
|
|||
Option Explicit
Sub testme() Dim FirstRow As Long Dim LastRow As Long Dim iRow As Long Dim wks As Worksheet Set wks = Worksheets("sheet1") With wks FirstRow = 1 LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For iRow = LastRow To FirstRow Step -1 If LCase(.Cells(iRow, "A").Value) = LCase("x") Then .Rows(iRow + 1).EntireRow.Insert End If Next iRow End With End Sub Will insert a new row after if it finds an X in column A. (after that row). chris wrote: "Dave Peterson" wrote: Formulas can return values to the cell--they can't insert rows above (or below). chris wrote: I want to run a a IF statement to qualify a row of data, and them if the condition is true, I want to insert a blank row below the current row where the fomula resides. I could also rework the formula to allow for the insertion of the blank row to be above the current row, as well. Either would work. Any assistance would be great! -- Dave Peterson I understand. Then, is there a way to insert a blank row from a Macro.. one that would look at a one consistent cell within a row to qualify the insertion (ie...for any row where column A contains "X", then insert a row?? Thanks. -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to Insert function right on text values e.g. 0180001640 | Excel Worksheet Functions | |||
Challenging Charting | Charts and Charting in Excel | |||
How do I insert a row when using an if function | Excel Worksheet Functions | |||
I need a function to update sales/expenses based on previous tota. | Excel Worksheet Functions | |||
Is there a formula to spell out a number in excel? | Excel Worksheet Functions |