Thursday, July 29, 2010

How to learn VBA in easy way?

Base on my experience learning VBA is really fun because after created you can try instantly to check whether your coding is correct or not. By doing this we can learn from try and error because no harm if you repeat again and again. Now here is the step you can follow to learn VBA:
  1. Record function
    Record your macro and try to understand the coding
  2. Try and Error
    Edit the recorded code and give another try and see the result
  3. VBE help
    This is another source of tutorial because when we search certain keyword there is a lot of example that you can follow
  4. Internet (The best teacher in the world)
    There are many website offer free tutorial online. Clear example this blog… he he
  5. Group or Forum
    Joint Google group or forum for this topic for sure you found many tips and advise
  6. Of Course Books or e-Books (Suggested later if you wish..)
The above step was from my experience if you have better idea give your comments.
Good Luck.
Click here if you have any new project! Let us create for u for free.
Thanks

Macro recording limitation

When you use recording to create macro actually too many limitations because of flexibility for examples:
  1. Take longer step to completed
  2. Coding too long difficult for editing
  3. Unable to loop through workbooks, worksheets, rows and columns
  4. Unable to retrieve outside data
  5. Unable to call function or other sub
  6. Unable to do calculation and
  7. etc
Due to this limitation we must learn how writes visual basic programming language to create more advances macro application. This programming language actually not so difficult to learned if you understand English. Now you understand why we need to master visual basic programming language to be master of VBA.
Good Luck
Click here if you have any new project! Let us create for u for free.

How to record macro effectively?

Base on my experience macro recording process is simple but the most problematic is playback. Some time after playback too many errors occurred because of similarity in between workbook, worksheet or cell is not there and some time it was due to data distribution. Therefore before any recording being done you must plan ahead what is your future workbook look like for you to playback for example workbook name, sheets name and etc. Below tips is for you remember how to record macro effectively:
  1. Always begin one step behind.
    Example: If you wish to select sheet1 for every playback then before recording start you must select other sheets, same goes to range.
  2. If you use formula inside your macro then it is better to remove this formula by copy and paste value
  3. If you wish to fill certain range with formula or data use short cut key Ctrl(hold) + Enter(Followed)
  4. To select certain range in column always use short cut key Ctrl(Hold) + Shift(Hold) + arrow right(Followed)
  5. To select certain range in row always use short cut key Ctrl(Hold) + Shift(Hold) + arrow down(Followed)
  6. To select certain range for all always use short cut key Ctrl(Hold) + Shift(Hold) + End(Followed)
  7. Start and End with selecting Range A1
  8. Minimize the usage of scroll it will occupied your code for nothing
  9. Standardize sheets name
  10. Plan your recording step
Hopefully the above guide will help to minimize the playback error.
Good Luck
Click here if you have any new project! Let us create for u for free.

Tuesday, July 27, 2010

How to change button face for the macro?

If you still remember we can assigned any macro to the custom button but we only have smiley face. Actually this button is not limited to smiley face because we can customize by changing appearance included text. To do this we must get back to tools menu and select customize, during customize dialog box still open select this smiley button. There are 2 ways to change
  1. Right click at smiley face
  2. Click at Modify selection button

From the above figure you can see command to change button image and if you select another set of image will appeared. Just select this image and you're done.
If you choose command edit button image then button editor dialog box will appeared as below.



Now you can start creating your own image by changing the pixel inside picture box and click OK when you're done.
Good Luck
Click here if you have any new project! Let us create for u for free.

Monday, July 26, 2010

How to use macro from another workbook?

When you record a macro then save, it doesn't mean this macro can only be use for this workbook. This macro actually can be use for all open workbooks as long the original macro workbook still open. For example 1st workbook open contain macro and enable, after that open another workbook without macro inside. You still can run macro from new workbook by pointing to Tools menu; macro and macros then select your desired macro with condition new workbook open from the same root. For example your macro workbook opens from desktop with double click but new workbook from start menu – excel open then your macro will not take place.

From the above figure you can see if you run macro from another workbook file name appeared first and followed by macro name. As usual select this macro, then click run. You're done!

Good luck.


Click here if you have any new project! Let us create for u for free.