Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Excel - converting numbers to leters *Fixed*

 
Logged in as: Guest
arrSession:exec spGetSession 2,16,36512
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> Post a VBScript >> Excel - converting numbers to leters *Fixed*
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Excel - converting numbers to leters *Fixed* - 7/26/2006 7:29:15 AM   
  geek_01

 

Posts: 12
Score: 0
Joined: 4/24/2006
From: So.Cal.
Status: offline
* Thanks to the feedback from Ebgreen I fixed the problem

What this script does it allow you to use objExcel.Range Statements with variable column widths.
Basically all it does is covert a number into the weird alpha system used by excel.  For example the function would convert the number 27 into AA.


      

< Message edited by geek_01 -- 7/27/2006 10:21:24 AM >
 
 
Revisions: 4 | Post #: 1
 
 RE: Excel - converting numbers to leters - 7/26/2006 8:23:23 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Thanks for sharing your code with us. I personally hate the way that excel does columns. Just a couple of quick comments.

  • Commenting your code will make it much easier for others to get the maximum benefit from it.
  • Dimming all of your variables within the function will increase its encapsulation and make it much easier to re-use.
  • You should always test boundary conditions when you write code. In the case of this function, it fails for all multiples of 26. Here is the code that I used to test it:

      

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to geek_01)
 
 
Post #: 2
 
 RE: Excel - converting numbers to leters *Fixed* - 7/27/2006 7:58:49 AM   
  geek_01

 

Posts: 12
Score: 0
Joined: 4/24/2006
From: So.Cal.
Status: offline
Thank you very much for the comments Ebgreen.

< Message edited by geek_01 -- 7/27/2006 10:22:41 AM >

(in reply to geek_01)
 
 
Revisions: 2 | Post #: 3
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> Post a VBScript >> Excel - converting numbers to leters *Fixed* Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts