Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Get excel column letter from number

by duelafn (Parson)
on Jul 26, 2016 at 13:10 UTC ( [id://1168562]=note: print w/replies, xml ) Need Help??


in reply to Re: Get excel column letter from number
in thread Get excel column letter from number

Simple and elegant given that Excel has a max column of "XFD". I'd modify this to cache the column names and throw a fit if we go too far (eventually, the column cap will be increased or removed):

sub ltr_cached { state $ltr_cache = ["A".."ZZZ"]; return ($$ltr_cache[$_[0]] or die "column too big: $_[0]") }

Good Day,
    Dean

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1168562]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2024-04-24 19:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found