Do you have any Excel OCD habits?

Those of us born after 1900 can, of course, omit the use of the word 'Let'...

(a) :nya: + :stickouttounge:

(b) Somewhere - I thought it was on this forum, though I couldn't find it - is a thread where Nate mentions that he'll use LET due to something he read of Ken Getz'. And yes, I do it purely for stylistic reasons, I like it because it makes it clear that an assignment is happening and not a test. And yes, it probably helps that LETs were required back when I learned to program. But hey, at least I no longer use the Rem keyword.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I prefer Alt, D, F, F over making sure I select a range first (haven't progressed past using Excel 2003 key combinations yet for most things).

Is it an OCD to hate the "new" keyboard shortcuts?
 
mikerickson,

before you posted here and after I read the post above about rem...

I actually remember you using Rem. I thought it was pretty cool.

A few weeks back, noticed a post by mikrickson using the Rem, curious as a biginner, Looked in the help file and found it to be like the '...I thought Rem was new and better than '.

Funny.
 
...I thought Rem was new and better than '.

Funny.

A couple of other oldies but goodies that you might want to look up that are still in the language - and these two are not purely stylistic: LSET & RSET. They're actually more like a LET than a SET. Don't get used often, but if you have to exchange data using any kind of a fixed-width format, they can come in handy.
Code:
    Dim s As String * 25
 
    RSet s = "Rory's a real hoot":    Debug.Print "|" & s & "|"
 
Two habits of mine.

(1) I use the VBA prefix whenever I call something in the VBA object library, although I am happy to make the call via globals <GLOBALS>within that library eg.
Code:
Sub foo()
    VBA.MsgBox "Hello the world!"
 
   'I don't use either of these
    MsgBox "Hello the world!"
    VBA.Interaction.MsgBox "Hello the world!"
End Sub
If I'm answering a question on the forum, I generally try to make an effort to comply with the OP's style, although sometimes I end up creating an inconsistent mixture.




(2) Everything within a procedure is indented to at least one level, including declarations. A lot of VBA'ers seem to write code like this:
Code:
Sub foo()
 
Dim l As Long
 
    l = Cells(Rows.Count, 1).End(xlUp).Row
 
End Sub
or like this:
Code:
Sub foo()
 
Dim l As Long
 
l = Cells(Rows.Count, 1).End(xlUp).Row
 
End Sub

Whereas I would write:
Code:
Sub foo()
 
    Dim l As Long
 
    l = Cells(Rows.Count, 1).End(xlUp).Row
 
End Sub
 
Last edited:
One of my habits is to order inequalities so the smallest is to the left. As in
Code:
If 2 < x And x < 10 Then
What one sees is all in order, similar to a number line.

As opposed to the more common practice of putting the variable first
Code:
If x > 2 And x < 10 Then
 

Forum statistics

Threads
1,222,633
Messages
6,167,201
Members
452,104
Latest member
jadethejade

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top