Question: I am trying to make a macro for creating a pivot table. I need the Macro to select all of the data on the sheet; a friend of mine has helped me create the code above, however the macro only selects the first two columns of data instead of all 48 columns. Does anyone see any mistake we may have made? Any response would be greatly appreciated! There will always be 48 columns however there number of rows will vary from week to week. 

```
Dim lastRow As Long
Dim lastCol As Long

lastRow = 1
lastCol = 1

    While Sheets("Sheet1").Cells(lastRow, lastCol).Value <> ""
        lastCol = lastCol + 1
    Wend

lastCol = lastCol - 1

    While Sheets("Sheet1").Cells(lastRow, 1).Value <> ""
        lastRow = lastRow + 1
    Wend

lastRow = lastRow - 1

ActiveWorkbook.PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
    "Sheet1!R1C1:R" & lastRow & "C" & lastCol, Version:=xlPivotTableVersion12).CreatePivotTable _
    TableDestination:="", TableName:="PivotTable1", DefaultVersion:= _
    xlPivotTableVersion12

ActiveSheet.PivotTableWizard TableDestination:=ActiveSheet.Cells(3, 1)

```

Answer: 
A simple way is to just check in the handler to see whether it's the chosen language.

```
var chosen_language = 'English'; // This can be updated by some other code

$("#English, #Spanish, #German").click(function() {
    if (this.id != chosen_language) {
        blah blah blah;
    }
});

```
First of all, I don't think it's a proper/good way to bind `event handler` using `ID`s for `71` elements (you mentioned in your question) like

```
$( "#English, #Spanish, #German").click(...);

```

Instead, you can use a `class` for all of your elements like this

```
<a class='language' id="English" href="whatever">English</a>
<a class='language' id="Spanish" href="whatever">Spanish</a>
<a class='language' id="German" href="whatever">German</a>

```

In this case you don't need individual `ID`s but if you need for some other reason then you may keep an unique `ID` for each elements. Now to bind a `click` handler for all the `link`s that has the class `language`, you may use something like this

```
$(".language").on('click', function(e) {
    e.preventDefault();
    // Do whatever you want to do then update the click handler
    alert($(this).text() + ' is selected!');

    // Then update the click handler instead of removing it because
    // if you remove the click handler then next time yopu click the
    // link, it'll do it's default behavior, will be navigated away
    $(this).off('click').on('click', function(){ return false; });
});

```

Also, you can use a namespace for the `click` handler like

```
$(".language").on('click.langualeSelection', function(e) {
    e.preventDefault();
    // Do it once
    alert($(this).text() + ' is selected!');

    // remove only this handler, other handler will prevent default
    // behavior but if there is no other handler, then update it like
    // previous example given above to stop loading the linked page
    $(this).off('click.langualeSelection');
});

```

Another handler

```
$(".language").on('click', function(e) {
    e.preventDefault();
    alert('Another click handler for language class');
});

```

Check [this example](http://jsfiddle.net/s69gb/2/) for one click handler and [this example](http://jsfiddle.net/s69gb/5/) for more than one handlers but one handler will be `off` after it fired once.