Archive for the ‘Names’ Category.

Two popular tools updated.

Hi All,

As many of you know I give away a number of tools for Excel through my site www.jkp-ads.com. Today I have updated the two most popular downloads:

Name Manager (which I created together with Charles Williams, www.decisionmodels.com):

Most important change: the unused names filter now includes objects in its search, as well as VBA code. It makes the filter much slower, but way more useful in my opinion. Also, I have added the Greek character set so Name Manager doesn’t (wrongfully) think range names with Greek characters are corrupt.

So far, Name Manager has been downloaded about 50,000 times since I posted it on my site.

Flexfind

I have updated the user interface of Flexfind so (in my opinion) it is easier to use. Also, I have mimicked the find all behaviour of Excel: if you select multiple items in the found items list, Flexfind will create a (multiple) selection of areas of the found cells.

Flexfind is less popular than Name Manager, the download count is at about 23,000.

Enjoy!

Of course I am open to any comments, suggestions and -most importantly- lots of praise :-)

Regards,
Jan Karel Pieterse
www.jkp-ads.com

Converting Names to Local

When I create an external data table in Excel, I almost always want to have a named range that refers to every column. This way I can create array formulas and refer to column names rather than cell references. Which formula is easier to read?:

=SUM((LEFT(Assembly!Name,3)="AXI")*(Assembly!QuantityOnHand))
=SUM((LEFT(Assembly!B2:B174,3)="AXI")*(Assembly!G2:G174))

Another advantage is that the named ranges expand and contract when the external data changes. No need for dynamic ranges, because they're already built in.

To create these named ranges, I select the entire QueryTable and choose Insert > Name > Create and choose the Top checkbox. This creates a global range name based on whatever is in the first row of the selected range.

The downside is that this creates global names and I want local names. The reason I want local names, other than simply good practice, is that I may have the same name on a different sheet. In one workbook, I have a sheet with an external data query of raw materials and another sheet for finished goods. They both have a column called QuantityOnHand.

In order to change the names to worksheet-level, I wrote this macro:

Sub LocalizeNames()
   
    Dim nm As Name
    Dim wsh As Worksheet
    Dim sName As String, sRefersto As String
   
    Set wsh = ThisWorkbook.Worksheets("RM")
   
    For Each nm In ThisWorkbook.Names
        If nm.Parent.Name = ThisWorkbook.Name Then
            If nm.RefersToRange.Cells(0).Value = nm.Name And _
                nm.RefersToRange.Parent.Name = wsh.Name Then
                sName = nm.Name
                sRefersto = nm.RefersTo
                nm.Delete
                wsh.Names.Add wsh.Name & "!" & sName, sRefersto
            End If
        End If
    Next nm
End Sub

It looks for names whose Parent is the workbook (global names) and that are on the sheet in question. Of those, it looks for names whose Name property is equal to the cell above (cells(0)), which indicates that the name was created with Insert > Names > Create. Once the name has been identified, it saves the Name and Refersto properties so that the name can be recreated. The name is deleted and then recreated with the sheet name prefixed, thereby making it local or worksheet-level.

I tried simply changing the Name property, but nothing happened - the names stayed globally scoped. I tried deleting the name after I created a worksheet-level name, and nothing happened. I had to first delete the global name, then create the local one. By the time I was done, I realized that I should have just written my own Create routine instead of fixing already created names.

I think a 'Create Local Names' utility should be added to the Name Manager. What do you think?

Obscure Excel VBA error: “Invalid Picture”

As many of the frequenters of this great place will know, Charles Williams and I created The Excel Name Manager. The # 1 (FREE) tool on the web to work with defined names in Excel.

Well, we do occasionally get feedback on this tool (which is always appreciated!) and in all these years, we got two reports stating the tool didn't work at all, showing an "Invalid Picure" error which effectively prevented the tool from working.

So this appears to be a rather obscure error.

Colin Delane was kind enough to help me troubleshoot this problem (as he was the one experiencing it).

After some detective work, we nailed down the problem to one particular commandbutton on the NM's main form. This button has a picture (as the others on the top have too):

Screenshot of Name Manager buttons. I circled the offending button. Note that this button only shows in the FastExcel version of NM.

The odd thing is, that it appeared to be the format of the picture that was causing havoc.

Both Meta and BMP are OK (no error on user's system), but when we loaded a GIF picture format, the error occured reproducably.

Has anyone seen this before?

Regards,

Jan Karel Pieterse
www.jkp-ads.com

Name Manager 4 for Excel 2007 RTM

Hi all,

Now that Office 2007 is RTM, Charles Williams and I have released an Excel 2007 version of our Name Manager.

The only differences with the 97-2003 version are that it is saved in native 2007 xlam format and uses the new ribbon UI:

Enjoy.

Regards,

Jan Karel Pieterse
JKP Application Development Services

Name Manager 4 released

Hi everyone,

Since no new issues were reported for quite some time, I decided it is time to release Name Manager version 4.0.

Look here and here for previous posts and discussions on this version.

Enjoy!

Regards,

Jan Karel Pieterse
JKP Application Development Services

Name Manager 4: Last call before release

Hi all,

In this post I announced some updates to version 4 of the Name Manager.

Since I haven't had any bug reports for about four weeks, I have decided it is about time to release this version.

Before I do so, I give you guys (and girls of course!) a last chance to report any issues to me.

So have a go at it, break it! If I get no new issues back, I'll post the release in about one week.

Regards,

Jan Karel Pieterse
www.jkp-ads.com