Eric Ching wrote:
> How do I delete a row in an excel spreadsheet with win32ole?
> 
> I want to loop through some rows and delete a row if a cell in the row
> contains a certain value.
> 
> Here's the loop I am using:
> 
> excel.Range("h2:h305").each do |cell|
>   if cell.Value == "blah"
>     # DELETE ROW HERE
>   end
> end
> 

(2..305).each do |row|
  if worksheet.Range("H#{row}").Value == "blah"
    worksheet.Rows(row).Delete
    redo
  end
end

> 
> And,where can I find documentation for using win32ols with excel.  I've
> been looking but haven't found anything to my satisfaction.
> 

http://rubyonwindows.blogspot.com
http://rubyonwindows.blogspot.com/search/label/excel

David
-- 
Posted via http://www.ruby-forum.com/.