Home > database >  Google Sheet: How to prevent named range from being changed?
Google Sheet: How to prevent named range from being changed?

Time:08-06

I make some named range on my Google sheet like

order_id: A2:A1000

New rows are added to this sheet via Zapier. After a while, I found the named range has become

order_id:A2:A1035

How to prevent this behavior and make the range stays A2:A1000?

CodePudding user response:

I have been checking the documentation for Named ranges, it does not mention anything about that behavior.

I have been testing and I noticed the named range will expand when the rows are added within the range selected, not outside of it. I'd say the behavior is expected to avoid leaving data outside of the range accidentally.

If you are a Google Workspace customer you can try submitting a Feature Idea since I do not see a way to leave the named range locked.

CodePudding user response:

solution to this kind of depends on it's purpose and how you're using the named range downstream (in appScript?, just formulas?)

seems like the way to do this is to make the named range:

order_id: A2

then, in your code, use

sheet.getRange('order_id').offset(0,0,1000)

maybe?

  • Related