09-28-2010 02:36 PM
The premise is to populate a spreadsheet from left to right in the same row but incrementing the column letter only (ie - B4, then C4 etc). Attached I have customized an existing example VI that works for a 2 element array (ie - B4) but does not work for a 3 element array (ie - B40, then becomes B50). Keeping it simple, what is the best and easiest way to modify my existing code to always check the array size and automatically index back to 0 in order to properly increment the first letter only (ie - B) and not the number (ie - 4) ?
Thanks !
Barry
Solved! Go to Solution.
09-28-2010 02:48 PM
Instead of "automatically index back to zero" , why not just make it a zero instead of doing the array size -1-1 manipulations?
Of course this will all fall apart once you get to column Z.
Also look into the Excel Board. Don't post question there. It is just a link to other threads related to Excel. Some of them might give you better ideas how to manipulate your cell references.
09-28-2010 03:28 PM
Yup it works ! I modified the code as suggested (initializing index to always be 0 with a 0 constant). I tried various numbers of elements in the array and they all work !
Thanks for the suggestion !
Barry
09-28-2010 04:51 PM - edited 09-28-2010 04:51 PM
In case you ever have more than 26 columns (as Ravens Fan noted), here is some code I use to generate the column label from the column number (0=A,1=B,...).
09-29-2010 06:24 AM
Thanks for the code suggestion ! This will definitely come in handy for those Mega Data Spreadsheets that require data collection automation using LabVIEW !
Thanks again !
Barry