Greg Truby
MrExcel MVP
- Joined
- Jun 19, 2002
- Messages
- 10,030
(1) I use the VBA prefix whenever I call something in the VBA object library
Colin, I began specifying libraries for objects a couple years back due to the recommendation to do so in Professional Excel Development in order to guard against accidentally getting a Word range object instead of an Excel range if one's code get's ported to Word in an automation setting.
I know you also are active at ExtremeVBTalk where they cover a wide variety of platforms. Is there some type of a danger of code getting ported onto other platforms that you're guarding against?
Whereas I would write:
Code:Sub foo() Dim l As Long l = Cells(Rows.Count, 1).End(xlUp).Row End Sub
I indent the same and yes, I go a bit OCD and fix the indenting if someone posts code that isn't properly indented. Speaking of which, somebody around here posted some code where they aligned the AS's in the DIM. I am trying it out to see if I like it and thus far I kinda do...
Code:
Rem ___old way___
Dim strFullNameCurr As String, strFullNameHome As String, _
strHomePath As String, strCurrPath As String, _
lngResult As VbMsgBoxResult, i%
'// ___new way___
Dim strFullNameCurr As String, _
strFullNameHome As String, _
strHomePath As String, _
strCurrPath As String, _
lngResult As VbMsgBoxResult, _
i%
Last edited: