do you name your file Myfile?

LxQ

Well-known Member
Joined
Feb 9, 2006
Messages
619
Microsoft is getting on my nerves... I'm doing a tutorial and every time it tells me to rename a file or a field or anything, it's always MyFile, MySpreadsheet, Myfield, MyNewField, MyMyNewField... I was pretty aggravated to always go to My Documents or My Music.. does anyone at Microsoft think we name anything My..-something?
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I think that is just there way of insuring that you don't accidentally pick a reserved word for a variable when writing code. I have seen numerous problems that people have had with their code because they try to use words like "Cells" or "File" as variable names.

I usually do the same thing, precede all my variable with the word "My" to make sure I don't do the same thing. You could just as easily choose some other prefix, i.e. "foo", etc.
 
I use it as a standard variable prefix all the time, especially when writing sample code to post on the board. It has nothing to do with Microsoft suggestions and everything to do with what happens to pop in my head. It's just easy *shrug*
 
I too name everything "MyFile", "MyCell", "MyVariable", (etc.) and it has nothing to do with
Microsoft. I can't even say it's because it's easy, or just what pops into my head.
The reason I do it is plain & simple.

I do it because (as with everything else)... it's all about ME!

( :diablo: )
 
I often do it when writing examples too. I guess, because it's generic. But I can see how it could grate on the nerves after the 99th MySomething :x

It does have one advantage -- you can see when someone copied an example because it's full of MyVariables :wink:

Denis
 
Personally, I never name anything MyWhatever. So whenever I see one on my system, 99 times outta 100 it's something Microsoft created.
 
Something I apparently forgot to mention when I posted before: Other than using it in samples for the board, I *do* tend to re-write code for myself.

So, on my first runthrough I may name it "myVar" or something even more generic, but once I am sure everything is working I go back through and rename them to be something a bit more descriptive. And even then, this is not always the case. If it's just a one-off code, I'll just leave it. Depends on the situation.

That's just me, though. Everyone has their own style of coding :)
 

Forum statistics

Threads
1,222,731
Messages
6,167,891
Members
452,154
Latest member
lukmana_sam

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