Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF statements - use to insert/delete rows?
I know how to use IF statements to have do calculations or insert text or
numbers based on whether the IF statement is true or not. Is it possible to construct an IF statement that would physically change the spreadsheet? For example, IF <something is true insert a row? Or do you have to get into VBA to do things like that? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF statements - use to insert/delete rows?
Depends what you mean by "physically change the worksheet"
If, by that phrase, you mean your example of inserting a row, then, yes, you would need VBA. It's hard to give you a better answer than that without you giving us a specific example of what you're trying to accomplish. Dave -- Brevity is the soul of wit. "WRM" wrote: I know how to use IF statements to have do calculations or insert text or numbers based on whether the IF statement is true or not. Is it possible to construct an IF statement that would physically change the spreadsheet? For example, IF <something is true insert a row? Or do you have to get into VBA to do things like that? |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF statements - use to insert/delete rows?
If you want to avoid using VBA, then you could achieve this with a bit
of manual intervention. Suppose your IF formula returned "delete" in a column of cells if the row needed to be deleted - you could apply a filter to this column and select "delete". Then, by highlighting the visible rows and choosing Edit | Delete Row you can get rid of them in one operation. Hope this helps. Pete WRM wrote: I know how to use IF statements to have do calculations or insert text or numbers based on whether the IF statement is true or not. Is it possible to construct an IF statement that would physically change the spreadsheet? For example, IF <something is true insert a row? Or do you have to get into VBA to do things like that? |
#4
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF statements - use to insert/delete rows?
I meant not changing text/numeric values, but specifically, inserting a row
when a specific condition is met. My issue is I have a sheet where each row represents a school's enrollment over the last four years. For example "ADAMS SCHOOL" will have a row for 2006, 2005, 2004, 2003. But some schools may have just opened and only have one year of operation (or two or three). What I want to do is to set up another sheet which show each school with four rows - whether or not there is data. I'm trying to avoid manually working my way down the entire sheet, inserting rows, and was wondering if I could set up an IF statement that would be along the lines of: IF <condition INSERT ROW. I have a pretty good idea how to set up the condition part of the IF statement, but don't know if there's any way to give a command within the IF statement that would insert a row. "Dave F" wrote: Depends what you mean by "physically change the worksheet" If, by that phrase, you mean your example of inserting a row, then, yes, you would need VBA. It's hard to give you a better answer than that without you giving us a specific example of what you're trying to accomplish. Dave -- Brevity is the soul of wit. "WRM" wrote: I know how to use IF statements to have do calculations or insert text or numbers based on whether the IF statement is true or not. Is it possible to construct an IF statement that would physically change the spreadsheet? For example, IF <something is true insert a row? Or do you have to get into VBA to do things like that? |
#5
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF statements - use to insert/delete rows?
Good idea - actually, I need to insert rows, not delete (I've just posted my
specific issue in reply to Dave F's comments). I'd only insert a row when a certain condition is met. I'm just trying to avoid scanning through about 800 rows and inserting a row as necessary. I may just have to bite the bullet, though. "Pete_UK" wrote: If you want to avoid using VBA, then you could achieve this with a bit of manual intervention. Suppose your IF formula returned "delete" in a column of cells if the row needed to be deleted - you could apply a filter to this column and select "delete". Then, by highlighting the visible rows and choosing Edit | Delete Row you can get rid of them in one operation. Hope this helps. Pete WRM wrote: I know how to use IF statements to have do calculations or insert text or numbers based on whether the IF statement is true or not. Is it possible to construct an IF statement that would physically change the spreadsheet? For example, IF <something is true insert a row? Or do you have to get into VBA to do things like that? |
#6
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
IF statements - use to insert/delete rows?
Excuse me Pete N Dave...WRM...u want to insert a row in a worksheet which
represent one school...Why ? If you insert one row, it means there is a new school that enters in your worksheet...u have now 800...how many sxhools do you expect to be entered in the Worksheet ? I guess the rate of entry of rows will be so slow...u may wait for another excel version probably to insert more ? maybe you can just fill-in below the blank row and filter-sort if u wish. As u said "inserting a row AS NECESSARY"... "WRM" wrote: Good idea - actually, I need to insert rows, not delete (I've just posted my specific issue in reply to Dave F's comments). I'd only insert a row when a certain condition is met. I'm just trying to avoid scanning through about 800 rows and inserting a row as necessary. I may just have to bite the bullet, though. "Pete_UK" wrote: If you want to avoid using VBA, then you could achieve this with a bit of manual intervention. Suppose your IF formula returned "delete" in a column of cells if the row needed to be deleted - you could apply a filter to this column and select "delete". Then, by highlighting the visible rows and choosing Edit | Delete Row you can get rid of them in one operation. Hope this helps. Pete WRM wrote: I know how to use IF statements to have do calculations or insert text or numbers based on whether the IF statement is true or not. Is it possible to construct an IF statement that would physically change the spreadsheet? For example, IF <something is true insert a row? Or do you have to get into VBA to do things like that? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Getting all rows of data that have a value in a particular column | Excel Discussion (Misc queries) | |||
Rows & Columns in Excel | Excel Worksheet Functions | |||
Automatically inserting rows | Excel Worksheet Functions | |||
Hiding Rows if the linked rows are blank | Excel Discussion (Misc queries) | |||
flexible paste rows function that inserts the right number of rows | Excel Discussion (Misc queries) |