I have an Excel sub that uses the Split()
function to split CSV data from a cell into an array. However, depending on the version of Excel/OS I'm using, the character used as the line break delimiter changes:
Excel 2011 / Mac OSX:
fullArray = Split(CSV, vbNewLine) 'successfully returns array
fullArray = Split(CSV, Chr(10)) 'fails and returns only a single cell
Excel 2007 / Windows 7:
fullArray = Split(CSV, Chr(10)) 'successfully returns array
fullArray = Split(CSV, vbNewLine) 'fails and returns only a single cell
Anyone else noticed this/has an explanation why this is going on?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…