Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   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 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default 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   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?

  #5   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?

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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 117
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting all rows of data that have a value in a particular column Rikki-Handgards Excel Discussion (Misc queries) 30 December 10th 07 12:29 PM
Rows & Columns in Excel seadragon69 Excel Worksheet Functions 2 December 7th 05 05:54 PM
Automatically inserting rows ausdiver99 Excel Worksheet Functions 1 June 2nd 05 02:15 PM
Hiding Rows if the linked rows are blank KG Excel Discussion (Misc queries) 9 May 18th 05 02:32 AM
flexible paste rows function that inserts the right number of rows marika1981 Excel Discussion (Misc queries) 1 February 18th 05 02:40 AM


All times are GMT +1. The time now is 07:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"