Posts by Reafidy

    Re: Clearing variables end macro's end


    Quote

    The origin of option Expicit is neither of the 4 aspects you mention.
    It's a relic form the time where 64k was the maximum RAM.


    I would love to know where you learnt or more likely assumed that from. Regardless, the origin is not so important. Whats important is the reasons for using it vs not using it.


    Quote

    We were discussing VBA, not Visual Studio.


    With that comment you obviously missed the point. My point was that VBA is often a starting block to other more complex languages in which they will need to declare variables. It is important for them to understand best practices.


    Quote

    A userfriendly programming language (VBA is meant to be one) should have a compiler that does all the translations from your variables to the hardware ( the origin of option explicit).


    Just because its user-friendly it doesn't mean we should all be lazy. How are new developers suppose to learn about variables types when then not declaring any?? If option explicit is such a relic, please tell me why it is used in modern languages?? And foremost please tell me the advantages of NOT declaring variables??


    Quote

    From where derives the tendency to prescribe things to others (even underlined by an unconvincing, non rational 'period' )


    Its an opinion and it comes from experience!


    Quote

    Why not relying on showing the advantages of your coding style and letting everyone choose for themselves

    You will find plenty of my code at Ozgrid and stackoverflow. I don't post here much anymore because I now mainly work with vb, c#, .net, asp.net, html, sql, java and android. In all of these other languages we need to declare variables, i'm certainly glad you weren't around to teach me bad habits when I learnt vba.

    Re: Clearing variables end macro's end


    Quote

    in VBA declaring variables (aside form necessary ones like Private or Public) serves no real purpose.


    Wow, just wow! That's a statement I have never heard from an advanced/experienced developer. Here -I will give you some:


    Readibility
    Past, present and future! In complex vba projects it will soon get messy having not declared variables and think about the future, its not so readable when you have to come back to it two years down the track and you haven't declared your variables!!!

    Multi-Developer environments.

    You may be able to read your code but can everyone else understand it? Best practices exist for a reason. If you progress into multi-developer environments, such as visual studio you may well be working with others who will need to read and understand your code. Even excel vba projects may have multiple developers.


    Debugging
    http://www.cpearson.com/excel/declaringvariables.aspx

    Speed
    Computer processing speed has increased yes, so has the demand for capability just look at how the amount of maximum rows and columns in excel has increased over the years. Although not a true database system excel has plenty of ability and when used in this form, complex vba projects that are data driven will start to slow down if you don't get the basics right. User's expect clicks to execute instantly. Delays either mean showing progress bars or the user thinking the computer has locked. Avoiding progress bars in complex projects means code needs to be efficient. Efficient is not all variables as variants.


    Use option explicit as a beginner, period. Once you advance and become more experienced then sure, use it your own discretion. Just be sure you have the good habits to back yourself. :)

    Re: First & Last Row Of Used Range


    Quote from bs0d;719024

    This code probably doesn't work because the cells() function is expecting a numerical values for row, column and you're passing a string "C" to it. Try 3 instead and you may have better luck.


    That is incorrect the cells function can accept a string in the column argument. Also, please note this is an old thread.

    Re: Move dubles from column to row


    alex87, regarding the report post function: Note: This is ONLY to be used to report spam, advertising messages, and problematic (harassment, fighting, or rude) posts.


    Do not use it to say thanks.

    Re: Backup a xlam workbook


    zplugger,


    Roy was actually asking a perfectly legitimate question and only trying to help.


    By posting a question on a free help forum - asking for help, you have indeed asked for other people's opinions. I suggest in future you show more respect and be grateful to those offering you free assistance... or find another forum that suit's your poor attitude.


    PM me when you have made up your mind and I will unlock your thread.

    Re: Macro to remove duplicates (If duplicate meets all three criteria)


    Have you ever heard the analogy (see the link in my signature) that cross-posting is like calling 10 cabs and jumping in the one that arrives first.


    By providing the link, you are now ordering a cab and saying "by the way I have also ordered a cab from another company so I will take which ever one gets here first".


    Here' a suggestion, ring a cab company, give them time to send a cab, if it doesn't turn up within a respectful time then ring another cab company.


    With regard to excel forums (not cab company's) at least 12 hours is a reasonable time frame. Thank you for providing the link, a lot of people don't. Just trying to help you further.