Saturday, June 27, 2015

Be a VBA professional developer in just One weekend !!!

The wait is over....

Be a VBA professional developer in just One weekend !!!

Weekend batches specially designed for working professionals.

First time ever, the most optimized and efficient VBA training in Pune (Weekend Batches only)

Applicable for professional with NO programming background AS WELL (should have hands-on to MS Excel).

Starting first batch in July 2015..

Date - 18th and 19th July.
Time - 8.00 AM to 4.00 PM.

Fees include Training, Printed course Materials, Tea/Coffee, Snacks for both days.

Venue - Narayan Peth, Near ABC chowk, Pune.

Registration open...Only 10 seats per batch...

For registration: please drop a note and your contact number to xplorevba.blogspot.com

Friday, November 9, 2012

Best VBA Classes / Best VBA Training in Pune

Hi All,

One of my very close friend would be soon starting VBA training in Pune (MS Excel VBA training) . This VBA coaching is available only on weekends only so as to enable working professionals to join in.

This training is designed in a way that any layman(having no programming background) can also learn VBA in just 2 days.

Learn VBA and kick start the career in challenging field of MIS and Process Improvements. Career opportunities are immense if you get to the Expert level in VBA. Countries like USA, UK and Australia are having tonnes of jobs for VBA developer.

This would be first best in class VBA training in Pune. Faculty is having 7 ++ yrs experience in VBA development and Data analysis . Personal attention to every candidate is ensured by limiting only 10 candidates per batch.

Content consists of What is programming - To - Programming Excel with VBA, Control structures, IDE and practical assignments. (assignement evaluation post training as well.)

So, hurry up.. Contact now on xplorevba@gmail.com for more details.

Thursday, August 2, 2012

Using dictionary to get sub-totals...The fastest way to subtotals using VBA

Hello All,

Today we are going to look at how to get subtotals of a data using VBA.

Consider following example ;

We are having "serial number" in column "A", "Person name" in column "B" and "Amount" in column "C". We need to get person wise total amount in column H. Let see how we can achieve this using dictionary structures in fastest way.

Refer to both the subroutines below. They both do the same thing in different way.

Sub GetSubTotalsUsingDictionaryStructure()

Dim i As Integer
Dim j As Integer

'DECLARE AND SET AN OBJECT OF A DICTIONARY
Dim dic_MySubTotal As Scripting.Dictionary
Set dic_MySubTotal = New Scripting.Dictionary

'LOOP THROUGH THE DATA AND LOADS THE DICTIONARY
For i = 2 To Sheet1.Range("A" & Sheet1.Cells.Rows.Count - 1).End(xlUp).Row
    If Sheet1.Range("B" & i).Value <> "" Then
        If Not dic_MySubTotal.Exists(Trim(Sheet1.Range("B" & i).Value)) Then
            'ADDS THE VALUE TO DICTIONARY IF NOT ALREADY PRESENT
            dic_MySubTotal.Add Trim(Sheet1.Range("B" & i).Value), Sheet1.Range("C" & i).Value
        Else
            'IF ALREADY PRESENT, SUMS UP THE EARLIER VALUE WITH CURRENT VALUE AND REPLACE THE ITEM
            dic_MySubTotal.Item(Trim(Sheet1.Range("B" & i).Value)) = _
                dic_MySubTotal.Item(Trim(Sheet1.Range("B" & i).Value)) + (Sheet1.Range("C" & i).Value)
        End If
    End If
Next

j = 2   'Initiate the row variable

For Each Var In dic_MySubTotal.Keys
    With Sheet1
        .Range("H" & j).Value = Var                         'GETS PERSON NAME
        .Range("I" & j).Value = dic_MySubTotal.Item(Var)    'GETS ITs TOTAL FROM DICTIONARY
    End With
Next

'RELEASES THE OBJECTS
dic_MySubTotal.RemoveAll
Set dic_MySubTotal = Nothing

End Sub

'-------------------------------------------------------------------------------------------------------------------

Sub GetSubTotalsUsingDictionaryStructure_1()

Dim i           As Integer
Dim j           As Integer
Dim int_LastRw  As Integer

'DECLARE AND SET AN OBJECT OF A DICTIONARY
Dim dic_MySubTotal As Scripting.Dictionary
Set dic_MySubTotal = New Scripting.Dictionary

'LOOP THROUGH THE DATA AND LOADS THE DICTIONARY
For i = 2 To Sheet1.Range("A" & Sheet1.Cells.Rows.Count - 1).End(xlUp).Row
    If Sheet1.Range("B" & i).Value <> "" Then
        If Not dic_MySubTotal.Exists(Trim(Sheet1.Range("B" & i).Value)) Then
            'GETS THE LAST ROW OF SUBTOTAL TABLE
            int_LastRw = Sheet1.Range("H" & Sheet1.Cells.Rows.Count - 1).End(xlUp).Row + 1
            'ADDS THE VALUE TO DICTIONARY IF NOT ALREADY PRESENT AS A KEY .....
            'DESTINATION TABLE ROW NUMBER AS ITEM
            dic_MySubTotal.Add Trim(Sheet1.Range("B" & i).Value), int_LastRw
            'ADDS THE DISTINCT VALUE TO DESTINATION TABLE
            Sheet1.Range("H" & int_LastRw).Value = Trim(Sheet1.Range("B" & i).Value)    'PERSON NAME
            Sheet1.Range("I" & int_LastRw).Value = Trim(Sheet1.Range("C" & i).Value)    'VALUE
        Else
            'IF ALREADY PRESENT, SUMS UP THE EARLIER VALUE WITH CURRENT VALUE AND REPLACE THE ITEM
            'GETS THE ROW OF SAME PERSON IN DESTINATION TABLE
            j = dic_MySubTotal.Item(Trim(Sheet1.Range("B" & i).Value))
            'ADDS THE AMOUNT TO DESTINATION TABLE CURRESPONDING LINE
            Sheet1.Range("I" & j).Value = Sheet1.Range("I" & j).Value + _
                                          Sheet1.Range("C" & i).Value
        End If
    End If
Next

'RELEASES THE OBJECTS
dic_MySubTotal.RemoveAll
Set dic_MySubTotal = Nothing

End Sub


Attached is the sample workbook with this code. Click here to open the workbook.

Note: You can also use the code to get distinct values from data with minor modifications.

Thanks,
xploreVBA

Tuesday, November 15, 2011

How to plot COUNTIF for multiple criterias ???? Lets find out...

Hi All,


Recently, I had to struck my head on my desk trying out for plotting a "Countif" Formula with multiple criterias. I invested almost 2-3 hrs in office googling for the same.. Nothing was the result !!!!


Then, Somehow I could recollect my Excel formula encyclopedia in my mind and used "SUMPRODUCT" to get the result.


Wanna know How do I do it ...? Let me explain ...


I have below table out of which I wasnted to derive 2 things :
  Q1. How many employees have a valid Passport and Valid Visa ?
  Q2. Q . How many employees do have a valid Passport but don’t have a Valid Visa ?


Obviously, data being so small , I can just figure it out by looking at it ... but when data is huge, I need to use SUMPRODUCT...(as given in screenshot below :


Employee
Has an passport ?
Has an valid Visa ??
A
YES
NO
B
NO
NO
C
YES
YES
D
YES
NO




so, my answers would be below formulas :
Q1. =SUMPRODUCT(--($B$2:$B$5="YES"),--($C$2:$C$5="YES"))
Q2 .=SUMPRODUCT(--($B$2:$B$5="YES"),--($C$2:$C$5="NO"))

So, the formula is :

=SUMPRODUCT(--(Range,Criteria),--(Range,Criteria),.....)

IMPORTANT :
DO NOT FORGET "--" (Double hyphen) AS IT PLAYS A KEY ROLE IN ARRAY FORMULAS.

Check and let me know, guys....

Keep enjoying the posts....

Tuesday, August 30, 2011

VBA Consultant's Guide for Clients / Developers.

Hi All,

Here are some FAQs that will help Clients as well as Freelance VBA developers in their business to take wise decisions.

Monday, February 7, 2011

Using SQL with VBA.

Hi All,

Since long time i havent posetd on blog...thats coz i was studying how to put VBA and SQL together...

I have got one PDF which is very good and would be like to share with you all..


Hope, you all enjoy it ....

Have a nice day..

Thursday, September 9, 2010

Basics of VBA

Here is the first thing that you need to know to learn VBA:

http://en.wikipedia.org/wiki/Visual_Basic_for_Applications

Some advanced VBA codes are available on : ( I liked it very much)

http://www.cpearson.com/Excel/ExcelPages.aspx

Enjoy...