My goalexpected result is to have a dropvery simple -down list with I have used data validation to place a "JUMP" button. The words in this drop-down list will be a collection of about 85 column titles in a cell. Since there are so many columns When a user selects a column title and clicks the button, I want the userthem to selectbe taken to the columnCOLUMN where that word is the title.
For example, thenuser selects "Game 5", which is in column 34. They click the button"JUMP" and automatically jumpare taken to that exact columnColumn 34 Row 1.
I've done this before with jumping to rowsLikewise, but am having issues figuring it out for columns - I could not find anything like thisuser selects "Game 52", which is in column 76. User clicks "JUMP" button and is taken to Column 76 Row 1.
Here's what I have so far:
MATCH function set up in Cell AP1, searching for the dropdown value location within the top row. This basically returns the Column # that I want the jump button to move to.
Then, I have my script:
function jump2() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var s = ss.getSheetByName("ClassicGames"); // change to sheet containing dates
var r = s.getRange("AP1").getValue(); //change A1 to cell containing =match formula
s.setActiveSelection(s.getRange(r));
}
I thought maybe this combination would just take me to whatever number the MATCH function finds. For instance, if r = 35, the user will move to the 35th column.
I thought maybe s.column would work, but it appears I am just making up functions at this point.
Any ideas?