Google Script Activate Sheet based on Reference Cell
up vote
0
down vote
favorite
I am trying to activate a sheet based on a reference cell. For example, based on a formula I have in cell J13, it will change between Sheet 2, Sheet 3, or Sheet 4. This would then tell the script which sheet to run a script to hide rows. The row hiding works well, I just need the reference to work. It seems something close to:
var ss = SpreadsheetApp.getActiveSheet().getSheetByName('Sheet 2');
But I want the 'Sheet 2' to be dynamic based on the value in cell J13.
google-apps-script
add a comment |
up vote
0
down vote
favorite
I am trying to activate a sheet based on a reference cell. For example, based on a formula I have in cell J13, it will change between Sheet 2, Sheet 3, or Sheet 4. This would then tell the script which sheet to run a script to hide rows. The row hiding works well, I just need the reference to work. It seems something close to:
var ss = SpreadsheetApp.getActiveSheet().getSheetByName('Sheet 2');
But I want the 'Sheet 2' to be dynamic based on the value in cell J13.
google-apps-script
So read the value ofRange
"J13" into where you have written'Sheet 2'
? Use the in-editor autocomplete and the handy-dandy Help ->Documentation menu to learn the language you are using.
– tehhowch
Nov 19 at 16:01
Thank you for your suggestion. I'm not very experienced with this and their documentation doesn't make much sense to me, hence me asking the question on a forum.
– user10675503
Nov 21 at 14:56
Look up the classRange
. Also the classSheet
. From aSheet
, you can get aRange
. From aRange
, you can get a value.
– tehhowch
Nov 21 at 22:11
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am trying to activate a sheet based on a reference cell. For example, based on a formula I have in cell J13, it will change between Sheet 2, Sheet 3, or Sheet 4. This would then tell the script which sheet to run a script to hide rows. The row hiding works well, I just need the reference to work. It seems something close to:
var ss = SpreadsheetApp.getActiveSheet().getSheetByName('Sheet 2');
But I want the 'Sheet 2' to be dynamic based on the value in cell J13.
google-apps-script
I am trying to activate a sheet based on a reference cell. For example, based on a formula I have in cell J13, it will change between Sheet 2, Sheet 3, or Sheet 4. This would then tell the script which sheet to run a script to hide rows. The row hiding works well, I just need the reference to work. It seems something close to:
var ss = SpreadsheetApp.getActiveSheet().getSheetByName('Sheet 2');
But I want the 'Sheet 2' to be dynamic based on the value in cell J13.
google-apps-script
google-apps-script
edited Nov 21 at 14:53
asked Nov 19 at 15:29
user10675503
42
42
So read the value ofRange
"J13" into where you have written'Sheet 2'
? Use the in-editor autocomplete and the handy-dandy Help ->Documentation menu to learn the language you are using.
– tehhowch
Nov 19 at 16:01
Thank you for your suggestion. I'm not very experienced with this and their documentation doesn't make much sense to me, hence me asking the question on a forum.
– user10675503
Nov 21 at 14:56
Look up the classRange
. Also the classSheet
. From aSheet
, you can get aRange
. From aRange
, you can get a value.
– tehhowch
Nov 21 at 22:11
add a comment |
So read the value ofRange
"J13" into where you have written'Sheet 2'
? Use the in-editor autocomplete and the handy-dandy Help ->Documentation menu to learn the language you are using.
– tehhowch
Nov 19 at 16:01
Thank you for your suggestion. I'm not very experienced with this and their documentation doesn't make much sense to me, hence me asking the question on a forum.
– user10675503
Nov 21 at 14:56
Look up the classRange
. Also the classSheet
. From aSheet
, you can get aRange
. From aRange
, you can get a value.
– tehhowch
Nov 21 at 22:11
So read the value of
Range
"J13" into where you have written 'Sheet 2'
? Use the in-editor autocomplete and the handy-dandy Help ->Documentation menu to learn the language you are using.– tehhowch
Nov 19 at 16:01
So read the value of
Range
"J13" into where you have written 'Sheet 2'
? Use the in-editor autocomplete and the handy-dandy Help ->Documentation menu to learn the language you are using.– tehhowch
Nov 19 at 16:01
Thank you for your suggestion. I'm not very experienced with this and their documentation doesn't make much sense to me, hence me asking the question on a forum.
– user10675503
Nov 21 at 14:56
Thank you for your suggestion. I'm not very experienced with this and their documentation doesn't make much sense to me, hence me asking the question on a forum.
– user10675503
Nov 21 at 14:56
Look up the class
Range
. Also the class Sheet
. From a Sheet
, you can get a Range
. From a Range
, you can get a value.– tehhowch
Nov 21 at 22:11
Look up the class
Range
. Also the class Sheet
. From a Sheet
, you can get a Range
. From a Range
, you can get a value.– tehhowch
Nov 21 at 22:11
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53377859%2fgoogle-script-activate-sheet-based-on-reference-cell%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
So read the value of
Range
"J13" into where you have written'Sheet 2'
? Use the in-editor autocomplete and the handy-dandy Help ->Documentation menu to learn the language you are using.– tehhowch
Nov 19 at 16:01
Thank you for your suggestion. I'm not very experienced with this and their documentation doesn't make much sense to me, hence me asking the question on a forum.
– user10675503
Nov 21 at 14:56
Look up the class
Range
. Also the classSheet
. From aSheet
, you can get aRange
. From aRange
, you can get a value.– tehhowch
Nov 21 at 22:11