Unprotect VBProject from VB code

I have never been in favor of Sendkeys. They are reliable in some case but not always. I have a soft corner for API’s though. What you want can be achieved, however you have to ensure that workbook for which you want to un-protect the VBA has to be opened in a separate Excel Instance. … Read more

Extract the last substring from a cell

This works, even when there are middle names: =MID(A2,FIND(CHAR(1),SUBSTITUTE(A2,” “,CHAR(1),LEN(A2)-LEN(SUBSTITUTE(A2,” “,””))))+1,LEN(A2)) If you want everything BUT the last name, check out this answer. If there are trailing spaces in your names, then you may want to remove them by replacing all instances of A2 by TRIM(A2) in the above formula. Note that it is only … Read more

How to add parameters to an external data query in Excel which can’t be displayed graphically?

Excel’s interface for SQL Server queries will not let you have a custom parameters.  A way around this is to create a generic Microsoft Query, then add parameters, then paste your parametorized query in the connection’s properties.  Here are the detailed steps for Excel 2010: Open Excel Goto Data tab From the From Other Sources button choose … Read more

Find if column contains value from another column?

You could try this =IF(ISNA(VLOOKUP(<single column I value>,<entire column E range>,1,FALSE)),FALSE, TRUE) -or- =IF(ISNA(VLOOKUP(<single column I value>,<entire column E range>,1,FALSE)),”FALSE”, “File found in row ” & MATCH(<single column I value>,<entire column E range>,0)) you could replace <single column I value> and <entire column E range> with named ranged. That’d probably be the easiest. Just drag … Read more

Excel: the Incredible Shrinking and Expanding Controls [closed]

The problem seems to relate to the way Windows handles non-native resolutions on monitors and can be avoided in several ways The problem can be a complete nightmare when it happens, but it only happens intermittently. We have been testing recently an excel worksheet used by a few dozen people and have developed a good … Read more