From: Todd Burch Date: 2007-07-24T21:58:29+09:00 Subject: Re: Inputting part of array into Excel Qwerty Qwerty wrote: > Newby Excel question > > The cells A1:A5 contain e.g. the following: > > #www.google.com > #www > > $x = worksheet.Range("A1:A5")['value']#['text']# read in a 2d array > (with 1 column and 5 rows) > $x.each do |$row| # Iterate through each of the rows in turn. > $test_site = $row[0] # use this to identify the column for the data in > $row. First, inside your loop, why are you treating the string like an array? I would code this: i = 1 ; $x.each do |site| # note there no need for a global variable # the first value will be "www.google.com" ... ie.goto(site) .... result = nil ; if (...true...) then result = "Passed" ; else result = "Failed" ; worksheet.Range("B#{i}").Value = result; i += 1 ; end ; Todd -- Posted via http://www.ruby-forum.com/.