+ Reply to Thread
Page 2 of 6 FirstFirst 1234 ... LastLast
Results 16 to 30 of 79
  1. #16
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Do's and Don'ts So Others Won't

    As if that could happen...
    So long, and thanks for all the fish.

  2. #17
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,139

    Re: Do's and Don'ts So Others Won't

    I wonder who did?......

  3. #18
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    Location
    Leeds, UK
    MS-Off Ver
    2003 (work), 2007 & 2010 (home)
    Posts
    3,517

    Re: Do's and Don'ts So Others Won't

    Re Option Explicit, I always use it, just never quote it in my posts.

    I don't use any VBA tools but keep meaning to look at them as I gather there are some very useful ones.

    Do learn about passing values to and from arrays (sooner than me anyway, they still confuddle me).

    Don't keep a bottle of lighter fluid in the booze cupboard

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    If you haven't already please take some time to read the Forum Rules.

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  4. #19
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Do's and Don'ts So Others Won't

    Quote Originally Posted by romperstomper View Post
    (unless of course you are trying to remain anonymous on an internet forum: it took one member here 3 posts to work out who I am. )
    I think I can probably guess who that might have been
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  5. #20
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Do's and Don'ts So Others Won't

    I suspect it was Richard Schollar... the same point holds true for formula bods also... everybody has a style to some extent (good/bad).

  6. #21
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Do's and Don'ts So Others Won't

    Quote Originally Posted by DonkeyOte View Post
    I suspect it was Richard Schollar.
    I actually would have guessed that it way you
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  7. #22
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Do's and Don'ts So Others Won't

    It was indeed Richard. Unnerved me a bit.
    So long, and thanks for all the fish.

  8. #23
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Do's and Don'ts So Others Won't

    Yeah, it is very hard to hide from your style...

    I also guessed a couple of members correctly....who had different names in other forums...
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  9. #24
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    Location
    Leeds, UK
    MS-Off Ver
    2003 (work), 2007 & 2010 (home)
    Posts
    3,517

    Re: Do's and Don'ts So Others Won't

    I assumed my whack it really hard with a hammer until it gives in style would have been transparent so saw little point in using a different name.

    Have we gone a little off topic here maybe?

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    If you haven't already please take some time to read the Forum Rules.

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  10. #25
    Forum Moderator NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003, 2007, 2010
    Posts
    31,163

    Re: Do's and Don'ts So Others Won't

    Quote Originally Posted by Domski View Post

    Have we gone a little off topic here maybe?

    Dom
    that tends to happen in many watercooler threads.... just like in real world watercooler conversations.... someone else comes into the lunch room and inserts different thoughts based on what they heard when they walked in...
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  11. #26
    Forum Guru Domski's Avatar
    Join Date
    12-14-2009
    Location
    Leeds, UK
    MS-Off Ver
    2003 (work), 2007 & 2010 (home)
    Posts
    3,517

    Re: Do's and Don'ts So Others Won't

    Some of the tangents that the Lounge at Mr Excel used to go off on were interesting to say the least, usually thanks to a certain Greg Truby.

    Dom
    "May the fleas of a thousand camels infest the crotch of the person who screws up your day and may their arms be too short to scratch..."

    If you haven't already please take some time to read the Forum Rules.

    Use code tags when posting your VBA code: [code] Your code here [/code]

    Remember, saying thanks only takes a second or two. Click the little star to give some Rep if you think an answer deserves it.

  12. #27
    Forum Moderator romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    Alibi
    MS-Off Ver
    All
    Posts
    8,262

    Re: Do's and Don'ts So Others Won't

    But you have to admire his high-falutin' language.
    So long, and thanks for all the fish.

  13. #28
    Forum Guru davegugg's Avatar
    Join Date
    12-18-2008
    Location
    WI, US
    MS-Off Ver
    2007
    Posts
    1,879

    Re: Do's and Don'ts So Others Won't

    Alright, pop-quiz hot shots. Do you re-use variables? If you have multiple (non-nested) loops, do you re-use i for integer?
    What if you use a string to find a workbook name using the application.getopenfilename dialog box. Would you redefine the string after opening the workbook to get rid of the path in the name?

    Examples:

    Code:
    Public Sub Example()
    
    Dim i As Integer
    Dim strFileName As String
    
    For i = 1 To 4
        Debug.Print i
    Next i
    
    For i = 8 To 4 Step -1
        Debug.Print i
    Next i
    
    strFileName = Application.GetOpenFilename(Title:="Please Choose a file to Open.")
    Workbooks.Open strFileName
    strFileName = ActiveWorkbook.Name
    
    End Sub
    Is your code running too slowly?
    Does your workbook or database have a bunch of duplicate pieces of data?
    Have a look at this article to learn the best ways to set up your projects.
    It will save both time and effort in the long run!


    Dave

  14. #29
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,213

    Re: Do's and Don'ts So Others Won't

    Personally, I wouldn't re-use a variable even in separate loops. If I ever needed to use multiple loops in code they would be doing different things, so I'd differentiate them to avoid any confusion. If this was 40 years ago and memory allocation was more of an issue, perhaps.

  15. #30
    Forum Moderator shg's Avatar
    Join Date
    06-21-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2007
    Posts
    25,137

    Re: Do's and Don'ts So Others Won't

    I reuse scratch variables if their scope of use is within a few lines of code, and I identify them as such in the declaration (I comment all my variable declarations as to purpose when I'm not just playing with my computer).

    For variables that index arrays, I name them consistent with the array; iChr indexes asChr, which has nChr elements.

    I wouldn't reuse your string variable below because in the first case it's a path and filename, and in the second, just the filename.
    Microsoft MVP - Excel
    Entia non sunt multiplicanda sine necessitate

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0