Quantcast
Channel: PHPExcel Forum Rss Feed
Viewing all articles
Browse latest Browse all 2707

New Post: How can I loop through G1 to AJ5

$
0
0
Hello! you might have already solved this, however i have a function that lets you handle any excel column letter as numbers. You might find it useful, i use it to loop though files that need a diferent amount of labels created every time...

Here it is:
//This function is for converting Numbers to Letters that are compatible with Excel, and Excel writter for cell selection
function num_to_letter($num, $uppercase = TRUE)
{
    $num -= 1;
    $letter =   chr(($num % 26) + 97);
    if ($num >= 26) {
        $letter = num_to_letter(floor($num/26),$uppercase).$letter;
    }
    return      ($uppercase ? strtoupper($letter) : $letter); 
}

Viewing all articles
Browse latest Browse all 2707

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>