Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
gus gus is offline
external usenet poster
 
Posts: 10
Default How to automatically insert a row if a cell meets a certain criter

I have a large amount of data with irregular patterns, and to perform an
additional amount of analysis, I need to insert a row under every time a
certain field is defined as a certain value (in this case FALSE). Is there
anyway I can do this without coding a full macro..ie with If functions and
Do/loops etc.

Cheers.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default How to automatically insert a row if a cell meets a certain criter

A simple macro will work, just change the array to match your criteria. Do
note that this doesn't check if the next row is blank (macro already ran).
One way to check might be to include ' And cell.offset(1,0).value = "" '
with your If statement.

Sub InsertRows()
For Each cell In Range("C1:C100")
If cell.Value = "FALSE" Then
cell.Offset(1, 0).EntireRow.Insert
End If
Next cell
End Sub
--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*


"Gus" wrote:

I have a large amount of data with irregular patterns, and to perform an
additional amount of analysis, I need to insert a row under every time a
certain field is defined as a certain value (in this case FALSE). Is there
anyway I can do this without coding a full macro..ie with If functions and
Do/loops etc.

Cheers.

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
How to return the value of a cell based on two colums match criter yimmin Excel Discussion (Misc queries) 2 November 6th 08 09:25 AM
Automatically hide column or row if a cell value meets criteria [email protected] Excel Worksheet Functions 3 June 10th 08 10:18 PM
Trying to use INDEX and MATCH to insert a value w/ multiple criter RS Excel Worksheet Functions 6 August 9th 07 09:36 PM
Highlight a row automatically if a cell meets certain criteria simonvrowley Excel Worksheet Functions 5 March 16th 06 11:16 AM
Excel: How to return count for each cell within date range criter. Louisa Excel Worksheet Functions 0 November 5th 04 11:58 AM


All times are GMT +1. The time now is 01:25 AM.

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

About Us

"It's about Microsoft Excel"