View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Raul Rodriguez Raul Rodriguez is offline
external usenet poster
 
Posts: 1
Default insert a row according a condition

Hello everybody,

I need to insert a blank row above each row that
has "PARAM_TYPE" as data on a single row as shown below:

NAME = ""_AppsCollect"", PARAM_TYPE = COLLECTOR
NAME = ""APPServerStatus"", PARAM_TYPE = CONSUMER
NAME = ""BORDER"", ...
NAME = ""LogIncreaseRate"", PARAM_TYPE = STANDARD

and I found the following macro that does something
similar, but this search for the word "Total" in column 1
and inserts a blank row after the match of "Total.

' insert a row after each row which contains "Total" in
column 1
Dim rCell As Range
For Each rCell In ActiveSheet.UsedRange.Columns(1).Cells
If rCell.Value = "Total" Then rCell.Offset
(1).EntireRow.Insert
Next rCell

Does anyone can tell me what do I need to modify in order
to do what I mentioned at the beginning.

Regards.

Raul Rodriguez.