Insights Blog
-- Browse All Articles --
Physics Articles
Physics Tutorials
Physics Guides
Physics FAQ
Math Articles
Math Tutorials
Math Guides
Math FAQ
Education Articles
Education Guides
Bio/Chem Articles
Technology Guides
Computer Science Tutorials
Forums
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Trending
Featured Threads
Log in
Register
What's new
Search
Search
Search titles only
By:
Intro Physics Homework Help
Advanced Physics Homework Help
Precalculus Homework Help
Calculus Homework Help
Bio/Chem Homework Help
Engineering Homework Help
Menu
Log in
Register
Navigation
More options
Contact us
Close Menu
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Forums
Homework Help
Engineering and Comp Sci Homework Help
Getting VALID range of Excel Cells in javascript
Reply to thread
Message
[QUOTE="iamjon.smith, post: 4709541, member: 292166"] [b]Solution[/b] [code]function validateRange(coordinate) { // A little input validation if (typeof coordinate != "string" || !coordinate.length) return false; // Find the first occurrence of a digit var startIndex = coordinate.search(/[\d+]/); // The column is the part from the beginning up until the first digit var column = coordinate.substring(0, startIndex).toUpperCase(); // The row is the remainder of the string var row = parseInt(coordinate.substring(startIndex), 10); // The column is sortable alphabetically so we can check its range, // and the row is numeric so we can check it's range as well return (column >= "A" && row >= 1) && (column <= "XFD" && row <= 1048576); }[/code] A friend on stack overflow (no link for respect for this site) provided me with this solution that worked perfectly, but I don't know how to mark a question as resolved on this forum. [/QUOTE]
Insert quotes…
Post reply
Forums
Homework Help
Engineering and Comp Sci Homework Help
Getting VALID range of Excel Cells in javascript
Back
Top