Tell me more ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I am trying to export a range of cells in a column using:

Import["BCD.xls", {"Sheets", "HazardRate", {15, 16, 17, 18, 19}, 3} ]

which works fine as data is what I expected, but why doesn't this for-loop work, and why Mathematica does not return errors or output?

For[j = 15, j <= 19, j++, Import["BCD.xls", {"Sheets", "HazardRate", j, 3} ] ]
share|improve this question
1  
Check the docs For>>More Information : Unless an explicit Return is used, the value returned by For is Null. See also the tutorial Loops and Control Structures – kguler Oct 25 '12 at 23:41
Import["BCD.xls", {"Sheets", "HazardRate", #, 3} ]&/@Range[15,19] might be what you are after. – image_doctor Oct 26 '12 at 0:03
Did you mean to write Import in the question title and not Export? – image_doctor Oct 26 '12 at 0:04
Can't you just put Import["BCD.xls", {"Sheets", "HazardRate", Range[15,19], 3}] – Cameron Murray Oct 26 '12 at 7:15

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.