Firstly, take a breath. Keep calm. Just because you're reading e-books,
googling for 2 months and you don't know how to use 'Dim'...doesn't mean
you should be ashamed. Humans are strange. They went to moon before
figuring out that it would be handy to install little wheels in luggage. My
point is - there is no exact sequence of learning. You only know when you
know.

Getting back to your thing. The major problem with learning VBA by oneself
is that - we don't know what to learn and from where to start. We know
there are codes, there are lines that appear in Greek but perform magic.
VBA is also a language but thankfully not as hard as Greek. So before you
set out, open VB editor and wander around, first thing first, have a task.
Start with simple tasks, preferably, the ones you have done already. Do it
again, manually, a couple of times, then record, and then, off you go.

With this idea in mind, here are a few tips which I collected from net and
added some of my own:

1. Use the recorder -

Excel’s built in Macro recorder is a great way to learn about new objects
and ways to deal with them. I use it all the time to record parts of my
code and then customize the output. Just keep in mind that macro recorder
does not produce the best or complete code all the time. But it gives you a
damn good idea about how to write code for a set of actions. Although the
code produced by the recorder might not make sense to you all the time but
it surely gives an idea of what you just done. A more effective way to get
the most out the macro recorder would be - "record something you know or do
well". For example - I know how to copy data from a sheet and paste it to
another sheet. I do it all the time. If I record that activity, I will get
a code that will copy certain data from a sheet and paste it on another
sheet. Now, if I were you, I would play around with it, you know, change
the cell references, change the sheet names, change the range which is
being copied or the destination. Further, I will record few other
activities like sorting the range and then copy that code in my earlier
code and try to make it one code which will copy, paste and sort. That's
how it works. Also, when recording a macro, do it a few times for the same
thing until you get whatever is being done accomplished in the fewest
steps. This will leave the least amount of goofy stuff you don't need. And
finally, to finish with macro recorder, I'll advise this: Record in parts.
If you have a long task that involves many things at once like, copying,
pasting, sorting, coloring, renaming, etc...record a separate macro for
each task. The code these individual macros would return, might be of one
or two lines only, but these lines will tell you exactly how things work in
that white little magicland.

2. Think it through -

The best way to solve even a very complex problem is to think through. Next
time, when you are about to automate that report or clean some imported
data using VBA, just write the logic down on a paper. See and understand
various aspects of the problem. The solution becomes clear to you and when
the solution is clear to you, further course towards achieving it becomes
easy in mind.

3. Use Immediate Window

Excel VBE has a powerful feature called as Immediate window. Think of this
like a sandbox. You can write almost any VBA statements here and get quick
results. For example, Open VBE (ALT+F11 in Excel) and go to Immediate
window.

-Type ?Activecell.Value
-Press Enter
-And you will see the current cell’s value printed in immediate window.

4. Read the help topics.

5. For each command/argument/function, there is a set method in which they
work. Try to find that correct method.

6. Never hesitate to ask when you're not "getting" something. As long as a
question is thoughtfully laid out, there are great guys here who will go
far out of their way and follow though until a solution is found or topic
understood. Prepare your query, make it concise, to the point, even just
copy the line of code that is giving a problem and send to someone, it
doesn't matter how you ask, but by all means - ask for help.

7. Read the help topics. Did I mention that already?

Another no. 7. Check how your code works -

Once you have a little that works or you're stuck somewhere, re-size the
VBA window in a way where you can see both the excel sheet and the VBA
editor at the same time. Now in VBA window, press F8. It will follow your
code line by line and you can see what is happening in the sheet.

8. Keep a Good Reference Handy -

If you are going to use VBA quite often, then invest in a good reference. I
suggest John Walkenbach’s Excel 2010 Power Programming if you are looking
for one. Good reference books have lots of information and tips buried in
them.

9. Find sites like - http://www.excel-pratique.com/en/index.php

10. Finally, if all fails, the remaining best way to learn is to find
someone who knows a bit and get them to show you around.

Lastly, have patience. No body learns VBA in a day and some don't even
learn in 20 years, for that matters.

Hope this helps.

Abhishek


On Fri, May 17, 2013 at 4:01 PM, Chaya <chayamon...@gmail.com> wrote:

> Thanks David sir,
>
>    yes you are right. self practice is the best platform for learning
> initial steps. thanks for the advice. and henceforth i will keep learning
> with the culture. but of all this, i think there should be a guidance which
> helps in learning by understanding the concepts.i mean there will be some
> certain tips or books  of guidance which help to undertand the fact for
> practicing. Since last 2 months, i have been reading ebooks and googling
> for the guidance, and even today, i am struggling in writing codes.
>
> Thanks once again
>
>
>
> Regards,
> Chaya
>
> The excel learner  :-)
>
>
> On Fri, May 17, 2013 at 3:45 PM, David Grugeon <da...@grugeon.com.au>wrote:
>
>> Two major things will help you.  One is the help files which are invoked
>> whenever you click on a word in a macro and then press F1.  I am sure you
>> have found that, but do you use it whenever you do not understand all about
>> a keyword such as Dim?
>>
>> The other thing is intellisense.  When you are typing in a sub or
>> function, the options for a command you are using will appear in a
>> drop-down list.  Try some of them and then press F1 to find out about it.
>>  For example, if you type
>>
>> Dim x as
>>
>> immediately you press the space after the as you will get a list of all
>> the types you can define a variable as.  This will be a lot of help to you.
>>
>> Also always click debug/compile on the menu before you run a procedure
>> you have written.  It checks that the syntax is correct, and shows you
>> where they are wrong.
>>
>> In context of this, always have "Option Explicit" at the top of all
>> modules.  This forces you to Dim each variable before you use it, and it
>> will show up any spelling mistakes in variable names.
>>
>> This list is best to help with specific queries rather than general
>> requests for help.  Always try to do as much as you can of a task before
>> asking for help and then show us what you have done and what it is doing
>> wrong.  If there are any error messages write them down exactly and tell
>> us, if it is possible to find out, what line the error occurred on.
>>
>> Above all, just keep writing and testing code and you will soon be one of
>> the ones giving the answers on the list.
>>
>> Regards
>> David Grugeon
>>
>>
>>
>> On 17 May 2013 20:00, Chaya <chayamon...@gmail.com> wrote:
>>
>>> Dear experts and all,
>>>
>>>       I am trying to learn excel macros from initial steps. please
>>> provide some advance tips to learn the source from initial. Actually, i am
>>> learning by recording the macros and trying to get the logic, but it does
>>> not make me fullfil to learn. even i reading ebooks and trying to practice
>>> in excel, but no effective.
>>>
>>>     After all, i use to get solution from google and from you all, even
>>> after reading and practice i am not getting the logical and its scripts.
>>>
>>>   Please advice me with your suitable suggestion and guidance.
>>>
>>> Say for small example :
>>>
>>>     even today i don't know how to use "Dim" after reading books, i know
>>> it is use for declaring values but i even don't know what and which value
>>> are to be use and where.
>>>
>>>   Please don't consider the above example, as it is just a small hint of
>>> mine and provide me some tips or advice from where i can understand clearly
>>> the logical coding and can write codes as per the necessity like you all.
>>>
>>> Thanks a millions to all.
>>>
>>>
>>> Regards,
>>> Chaya
>>>
>>> The excel learner  :-)
>>>
>>> --
>>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be?
>>> It’s =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>>> https://www.facebook.com/discussexcel
>>>
>>> FORUM RULES
>>>
>>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>>> will not get quick attention or may not be answered.
>>> 2) Don't post a question in the thread of another member.
>>> 3) Don't post questions regarding breaking or bypassing any security
>>> measure.
>>> 4) Acknowledge the responses you receive, good or bad.
>>> 5) Jobs posting is not allowed.
>>> 6) Sharing copyrighted material and their links is not allowed.
>>>
>>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>>> members are not responsible for any loss.
>>> ---
>>> You received this message because you are subscribed to the Google
>>> Groups "MS EXCEL AND VBA MACROS" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to excel-macros+unsubscr...@googlegroups.com.
>>> To post to this group, send email to excel-macros@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/excel-macros?hl=en.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>>
>>  --
>> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
>> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
>> https://www.facebook.com/discussexcel
>>
>> FORUM RULES
>>
>> 1) Use concise, accurate thread titles. Poor thread titles, like Please
>> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
>> will not get quick attention or may not be answered.
>> 2) Don't post a question in the thread of another member.
>> 3) Don't post questions regarding breaking or bypassing any security
>> measure.
>> 4) Acknowledge the responses you receive, good or bad.
>> 5) Jobs posting is not allowed.
>> 6) Sharing copyrighted material and their links is not allowed.
>>
>> NOTE : Don't ever post confidential data in a workbook. Forum owners and
>> members are not responsible for any loss.
>> ---
>> You received this message because you are subscribed to the Google Groups
>> "MS EXCEL AND VBA MACROS" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to excel-macros+unsubscr...@googlegroups.com.
>> To post to this group, send email to excel-macros@googlegroups.com.
>> Visit this group at http://groups.google.com/group/excel-macros?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
>>
>
>  --
> Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s
> =TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @
> https://www.facebook.com/discussexcel
>
> FORUM RULES
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
> 2) Don't post a question in the thread of another member.
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
> 4) Acknowledge the responses you receive, good or bad.
> 5) Jobs posting is not allowed.
> 6) Sharing copyrighted material and their links is not allowed.
>
> NOTE : Don't ever post confidential data in a workbook. Forum owners and
> members are not responsible for any loss.
> ---
> You received this message because you are subscribed to the Google Groups
> "MS EXCEL AND VBA MACROS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to excel-macros+unsubscr...@googlegroups.com.
> To post to this group, send email to excel-macros@googlegroups.com.
> Visit this group at http://groups.google.com/group/excel-macros?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to