Jun 30, 2020

How can I create a "button" on a Google Sheet that "allows" IMPORTANTRANGE() to function?

I have used Google Sheets for awhile, but am now finally getting into using more advanced functions, such as "IMPORTRANGE()". I currently have a work schedule in a Sheet that my employees can access to see what time they're scheduled to work that day. I used IMPORTRANGE to pull that data from my source file to the sheet that everyone views (so I can work on the sheet without having to hide tabs from everyone, I often forget). What I'm trying to do is find a way that I can "toggle" whether or not the "IMPORTRANGE()" function will work on a particular range. Almost like a "schedule post" button, where unless I "click" the button, or "check" the checkbox, in the source file, it won't allow the data to import from my source file. Hopefully that makes sense. Looking for some guidance if anyone can shed some light.

Thank you!
Locked
Informational notification.
This question is locked and replying has been disabled.
Community content may not be verified or up-to-date. Learn more.
Recommended Answer
Jun 30, 2020
Hello Nick P. 3537,
 
I think something like this would work. You have a checkbox in your sheet we'll use cell D2 just for this example. When you check that box the IMPORTRANGE() will show in the other sheet. It would look something like this.
 
=IF(IMPORTRANGE("url","yoursheet!D2")=True,IMPORTRANGE("url","yoursheet!data_range"),)
 
If that doesn't work or you still need more help with this I suggest that you share an editable COPY of your sheet. Use your sample sheet to demonstrate what you'd like the sheet to do!  Here are some tips to help you get a great answer quickly... Product Experts TIPS FOR SHARING  
 
Stephen
Original Poster Nick P. 3537 marked this as an answer
Helpful?
All Replies (6)
Recommended Answer
Jun 30, 2020
Hello Nick P. 3537,
 
I think something like this would work. You have a checkbox in your sheet we'll use cell D2 just for this example. When you check that box the IMPORTRANGE() will show in the other sheet. It would look something like this.
 
=IF(IMPORTRANGE("url","yoursheet!D2")=True,IMPORTRANGE("url","yoursheet!data_range"),)
 
If that doesn't work or you still need more help with this I suggest that you share an editable COPY of your sheet. Use your sample sheet to demonstrate what you'd like the sheet to do!  Here are some tips to help you get a great answer quickly... Product Experts TIPS FOR SHARING  
 
Stephen
Original Poster Nick P. 3537 marked this as an answer
Jun 30, 2020
That worked perfectly! Thank you! I suppose I have another question- is there a way to "hide" a particular range if the checkbox hasn't been checked? By using a function such as HIDE() (even though that particularly doesn't exist)?
Jun 30, 2020
Nick,
 
I'm glad my solution worked for you. As for hiding a range I think I have an idea of what you're wanting but it is difficult to visualize and build a working formula. I would probably need a sample sheet to work on. If you need more help please see the link I posted for directions on how to best share a sample.
 
Stephen
Jun 30, 2020
Stephen,

Easy enough. I have created a sample sheet; you should have edit access.


Thank you!
Jun 30, 2020
Nick,
 
You mean you want to actually hide the range? I was thinking just not display but to physically hide the range cannot be done with a formula. I am not a script writer so I don't know but that might be a possibility using a script.
 
Stephen
Jun 30, 2020
Stephen,

Yes, actually hiding the rows is what I wanted to do. Otherwise, it just sits there with the format setup waiting for the data. If that's the only thing I can do without a script, I can live with it for now. But if you have any other ideas please let me know.

Thank you,
Nick
false
14212129013760581367
true
Search Help Center
true
true
true
true
true
35
Search
Clear search
Close search
Main menu
false
false