LS: ole in excel, looping through cell range

I’m working with an excel file in LS.

I need to loop through a range, F1:F500 and check to see if a certain vvalue exists. If it does then change it to another value.

In excel macro, the following code works:

Dim Bcell As Range

For Each Bcell In Range(“F1:F500”)

If Bcell = "BAD_VALUE" Then Bcell = "GOOD_VALUE"

Next Bcell

would this be the equivalent in LS?

Forall x In objApp.Range("F1:F500")

	If x = "BAD_VALUE" Then x = "GOOD_VALUE"

End Forall

Thanks

ST

Subject: LS: ole in excel, looping through cell range

Perhaps something like this would work.xlws1 is your worksheet object…

For m = 1 To 500

if xlws1.Cells(m, 6).Value = “BAD VALUE” then

xlws1.Cells(m, 6).Value = “GOOD VALUE”

end if

Next

Cheers,

AJ