January 17, 2011 Leave a comment
I am now searching the WordPress.org forums for people needing help in embedding Excel in their posts. One of them was about allowing someone to search their name in a long list of names, and show the value of the other column in the table.
Below I built a simple example for this, with the top 100 baby names. Enter a name, and it will tell you what (if any) was its position in the top 100.
The workbook itself is fairly simple – just a table of boy and girl names and their “ranking”, and a vlookup formula into that table.
In terms of embedding, I am introducing 2 new concepts: showing only a range (as opposed to the whole workbook), and selecting the active cell.
My workbook has 2 sheets. I only wanted to show the first sheet, and only a few cells in it. This simplifies what it shown to the user. To do this, I first created a named range called ‘Form’ for the cells I wanted to show. Then, I add &Item=Form to the HTML snippet. Note that users can still get to the rest of the workbook, for example by pressing the “view full size workbook” button in the bottom Excel Web App bar.
I also wanted the selection to be on cell B2, so that users can enter the name w/o selecting another cell. I have added &ActiveCell=B1 to the HTML snipped, and… voila!