If you find any post useful then, please do share with others. Thanks!

Popular Posts

Contact

Email me

Need help and that also free? I like to learn this way, in case of any question or for a small task, please feel free to email me with details and example data, if required.

Friday, October 10, 2014

Compare 2 lists, Easy Way (Excel2010) & a VB Macro

1)      Compare two lists, Easy Way (Excel 2010)
We have two lists/columns of data. Each column should have unique data, use Data->remove duplicate option to remove duplicates of each column.
Select both the lists/Columns
Go to Home Tab > Condition Formatting > Highlight cell rules> Duplicate values.
This will highlight the duplicates that are in both columns and selecting unique in the Bar’s dropdown will highlight the unique values.





2)      Macro to Find Matches between two columns and copying in third
Our data is in Column A and C, running this Macro will put the matches (which are in both columns A & C) in column B.
Sub Matches()
    Dim CRange As Variant, x As Variant, y As Variant
    Set CRange = Range("C1:C2500")
    For Each x In Selection
        For Each y In CRange
            If x = y Then x.Offset(0, 1) = x
        Next y
    Next x
End Sub
   

Wednesday, September 24, 2014

Excel 2010: Fuzzy Lookup Add-In (Approximate Data Match)

Excel 2010: Fuzzy Lookup Add-In (Approximate Data Match)
We can use this Add-In for approximate data matching. Suppose we have two tables and there are spelling mistakes, abbreviations and short names used. So comparing such tables could be really a mess. But with this Ad-In we can do a lot, easily.
Download the Add-In: Download from the below link of Microsoft download center.
Once you have downloaded the Add-In, a Fuzzy Lookup tab would be visible on the Ribbon and that’s the command.



Our data should be in formatted tables, so If we want to compare the data of two tables, format them. For this select the data and press Ctrl L.
On the Ribbon click on Fuzzy Lookup command, this will open the pane/window.
Select the left and right tables to compare, if data of same table to be compared then select same as left, right.
The lookup will automatically join the same name columns; you can delete that join and add of your choice. For this select the column(s) (could be more than one) of both tables and click on the button which is in between the right & left columns window, this will add a join.
From the output columns, select the one which you want to see in results.
Leave the number of matches at the default of 1, or increase it to see more matches for each item in the left table.
Now Run the Lookup
For this, select a cell in an empty part of sheet, results will start populating from that cell. Click on Go button.
By Clicking on the configuration button, we can change the configuration as well to match our requirement.

Wednesday, September 17, 2014

Excel Macro: Highlight Every Other Row

Excel Macro: Highlight Every Other Row

Select the rows and run the below Macro (VB Code), this will highlight the every other row of your selection.
Saving Macro Code & assigning it to a button
For this first save the code, by going to Developer Tab and then clicking the Visual Basic. (If you don’t see Developer tab (Excel 2010) then go to the "File tab -> Options (under Help) -> Customize ribbon" and there tick the box of the Developer ribbon )
A new window will open now click on Insert > Module, paste the code there save and close the window. Now for putting a button in your sheet, go to Developer tab then Insert then Click on button (Form Control). Place it where you want.
Now right click on it and click on Assign Macro and assign this Highlight macro to that button. So now after you select your rows, clicking on this button will run the macro.

Sub Highlight()
Dim r As Integer
For r = 1 To Selection.Rows.Count
If r Mod 2 = 1 Then
Selection.Rows(r).Interior.ColorIndex = 37
End If
Next
End Sub



Tuesday, September 9, 2014

Unhide the very first column or row of a sheet

Unhide the very first column or row of a sheet
If the first row (Row1) or column (A Column) is hidden in the sheet then un-hiding it could be a bit tricky. The reason is that it’s hard to select that row or column. Though we can select the entire sheet and then unhide rows/columns but that will unhide all columns/rows that we might not want.
Below is an easy way mentioned to do this.
In the Name box which is next to formula bar, write A1 and then press enter button.
Now go to Home tab, in the cells group and Click on Format.
Now under Visibility, click Hide & unhide and then click on unhide rows or unhide columns.
This will unhide the column/row.


Monday, September 8, 2014

Lock Specified Area of a Protected Sheet

Lock Specified Area of a Protected Sheet
When we protect a sheet, all cells are locked by default for editing. For making editable all cells and leaving a few locked, we need to first unlock all cells and then lock specified cells before protecting a sheet.
v  If a sheet is already protected then unprotect it. (Review Tab)
v  Select the whole sheet by Selecting All Button or pressing Ctrl A
v  On the Home tab Click the Format Cells launcher, alternate way is through right click or Ctrl 1.    
v  Got to protection tab and clear the locked check box and click ok. This will unlock all the cells on the sheet, once protected.
v  In your worksheet select only those cells that you want to lock.
v  Again open Format Cells Launcher, same we did earlier.
v  On the protection tab, select the Locked check box and click Ok.
v  Got to Review tab and click Protect Sheet.
v  In the Allow users of this worksheet to list, select the components that we want user to be able to change.
v  In the password to unprotect sheet box, type a password for sheet. Please note the password step is optional, if we don’t provide then any user can unprotect by just clicking on unprotect option.