Please can someone point me in the right direction with this query.
I’ve done a few projects with Excel AS however this little query has me baffled at the moment.
I have a range of values in a column in Excel, all numerical 6 digit numbers.
Here’s a little snippet of what I’m looking at.
tell application "Microsoft Excel"
activate
set thisVal to string value of cell ("I2")
set thisList to value of range ("I2:I90")
end tell
If I get the content of a cell individually it returns it correctly.
However, if I use to the second method I get values like this:-
{4.00187E+5}, {4.00195E+5}, {4.00195E+5}
I’ve tried quite a few versions on a theme but still I get the above. I’ve also tried different cell formats. I’ve used both of the methods before and they’ve worked fine?
Please can someone show me how I should be selecting the range to get it into a list with all the content correct?
What do you mean by correct content?
Do you want a list like {1.23456E+5, 2.46912E+5}
If so, a loop is needed.
If you want integers, I don’t know why since they calculate like reals.
tell application "Microsoft Excel"
set integerList to {}
repeat with i from 1 to 3
copy {(value of (cell i of range "a1:a3") as integer)} to end of integerList
end repeat
set realList to {}
repeat with i from 1 to 3
copy value of (cell i of range "a1:a3") to end of realList
end repeat
set testList to {}
repeat with i from 1 to 3
copy ((item i of realList) - (item i of integerList)) to end of testList
end repeat
testList -- returns {0.0, 0.0, 0.0}
end tell