View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
WRM WRM is offline
external usenet poster
 
Posts: 3
Default 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?