Cool testing, table tag is working, BTW its default vbulletin feature
![]()
Function Code for getting Column Letter from Column Number
Shortened version used in Post #14
http://www.excelfox.com/forum/showth...=9837#post9837
Public Function CL(ByVal lclm As Long) As String
And Fuller version with explaining 'Comments
Code:Public Function CL(ByVal lclm As Long) As String ' http://www.excelforum.com/development-testing-forum/1101544-thread-post-appendix-no-reply-needed-please-do-not-delete-thanks-4.html#post4213980 Do: Let CL = Chr(65 + (((lclm - 1) Mod 26))) & CL: Let lclm = (lclm - (1)) \ 26: Loop While lclm > 0 End Function Function FukOutChrWithDoWhile(ByVal lclm As Long) As String 'Using chr function and Do while loop For example http://www.excelforum.com/excel-programming-vba-macros/796472-how-to-go-from-column-number-to-column-letter.html Dim rest As Long 'Variable for what is "left over" after subtracting as many full 26's as possible Do ' Let rest = ((lclm - 1) Mod 26) 'Gives 0 to 25 for Column Number "Left over" 1 to 26. Better than ( lclm Mod 26 ) which gives 1 to 25 for clm 1 to 25 then 0 for 26 ' Let FukOutChrWithDoWhile = Chr(65 + rest) & FukOutChrWithDoWhile 'Convert rest to Chr Number, initially with full number so the "units" (0-25), then number of 26's left over (if the number was so big to give any amount of 26's in it, then number of 26's in the 26's left over (if the number was so big to give any amount of 26 x 26's in it, Enit ? ' 'OR Let FukOutChrWithDoWhile = Chr(65 + (((lclm - 1) Mod 26))) & FukOutChrWithDoWhile Let lclm = (lclm - (1)) \ 26 'This gives the number of 26's ( if any ), but just the excact part, in the next number down , - so applying the rest formula to this new number will again leave a difference "left over" rest. 'lclm = (lclm - (rest + 1)) \ 26 ' As the number is effectively truncated here, any number from 1 to (rest +1) will do in the formula Loop While lclm > 0 'Only loop further if number was big enough to still have 0-25's in it End Function Rem Ref http://www.excelforum.com/development-testing-forum/1101544-thread-post-appendix-no-reply-needed-please-do-not-delete-thanks-4.html#post4213980 Rem Ref http://www.excelforum.com/tips-and-tutorials/1108643-vba-column-letter-from-column-number-explained.html
Let it be
2 reasons really:
_1) I am not sure if I have it right, I may not be using exactly the correct terminology, but my thinking is that you can broadly/ approximately speaking do three things to/with stuff/things in VB
_1(i) You assign an object , which VB knows to do if you use Set
_1(ii) You assign a value , which VB knows to do if you use Let
_1(iii) You use a Method/Property/Function of something , which VB knows to do if you don't use anything
But because VB is good at guessing/ distinguishing between (ii) and (iii) you can leave it out in cases (ii), and VB will use Let "internally" for you as the implicit default in whatever compile thingy it does/has.
I prefer not to use implicit defaults.
_2) Aesthetics.
My coding distinguishes itself, I feel, from others, in its beauty. My coding is beautiful. Those extra pretty blue Lets further add to its beauty, IMHO
http://www.eileenslounge.com/viewtop...271519#p271519
Another reason is it helps to distinguish the two Public Property procedures in Class things , ( The Let and Get stuff )
Simplified example: I have a Class module called Car, and I have a color property of it , CrColor
The relevant bit of my simplified Class Module is this
Private PrvteCrColor As String
Public Property Let CrColor(Clr As String)
Let PrvteCrColor = Clr
End Property
In a simple use within a normal code module I would use something of this form
Dim objCr As Car: Set objCr = New Car
__ objCr.CrColor = "Yellow"
That last code line is what effectively uses the Public Property Let . But I can write it as
Let objCr.CrColor = "Yellow"
So that’s quite helpful to the novice to help not get the Public Property Let and Get mixed up
https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA




, BTW its default vbulletin feature 

Bookmarks