Named Ranges have sheet name stuck in them when sheets are copied from certain spreadsheet - function

I'm merging the different versions of a D&D template and noticed that copying sheets from a certain one of them to an existing/new spreadsheet causes the Named Range names to contain the sheet name, but in some kinda ghost form (e.g.: if trying to edit the Named Range, the name shows normally). Any clue what's causing this, how to fix it, or how to get around it?
Though I manually fixed them all by deleting and re-creating back-to-back, that version of the template might get updated in the future and I'll have to consider repeating this process.
"copy of WildShape" spreadsheet
image - "copy of WildShape" sheet's
Named Ranges
see "WildShape" sheet of merged version

Related

Sharing google sheet with restrictions

I've built my google sheet, and shared it with the team, the sheet has an entry point, where the user is entering some data, and balance data of the sheet is changing dynamically based on this input.
If 2 persons are using the sheet at the same time, the data will be changed based on the last guy who use this entry field, and the data the other guy seeing will be changed accordingly.
my sheet is here
The sheet is locked except the yellow shaded cell, which is allowed to be changed by the user.
Is there a way to allow each user to see the data based on his input parameter, without getting it destroyed when used by others!
I don't think what you're looking for is possible as Sheets is designed to be used for collaboration and edits will always be shown in real time. Consider adding multiple sheets and assign them to each of your team members with the exact formatting and formulas as the original so they can access and input their data independently.

Transfer Google Spreadsheet Cell Value generated from ImportRange to another sheet and cell automatically

I have sheet named origin that displays set of data Col A:B via ImportRange
I have a sheet named destination
What I wanted to do:
When ImportData changes (a new item is added in the origin sheet) I wanted to copy that
item and paste it in the destination sheet.
What I dont want to happen:
Is copy data that are already existing in the destination sheet.
When ImportData Origin is sorted, the display in the origin sheet is
also changed. In this case I should still be able to copy data that
are not existing in the destination sheet even if both sheets are no
longer sorted the same.
Any idea on how I can achieve this?
Thank you so much
Explanation:
I would advice you to use a formula in the destination sheet, something like:
UNIQUE(IMPORTRANGE("url", "origin!A1:B"))
so you can have the unique items of the origin sheet in the destination sheet.
The reason that I am suggesting that is because you are looking for a trigger behaviour. Namely, when a new value is added in a cell, grab this value and send it to another spreadsheet. The problem with this approach is that Google-Apps-Script triggers are not triggered by scripts nor formulas, but only by user edits. In other words, if a cell is modified by your import range formula, there is not a direct GAS solution which can figure that out. Only workarounds exist which might have limitations and they are very specific to your exact use case.
Workarounds
See this thread for some info and references.
You can use the Properties Service which you can store some sort of data that is bound the script. In this way, you can create a Time-driven trigger which will run every 1 minute or so and check if there are changes to the original data. If a new value is added, update the property and send the data to the destination sheet. If no new data is added, do nothing.

Why do two users sometimes see different values from importrange?

I have a very strange problem, the description can be a bit chaotic.
I have two spreadsheets A and B. One sheet inside A is importing data with importrange from the B. The problem is that sometimes two user see different values in that sheet.
Details:
I have two scripts inside A:
one that copies the values from the imported range to another sheet
one that calls that WebApp that changes data in B.
When two users have the A open and one of them makes changes to the B via script and then uses the other script which copies the values, everything is fine. But if one user closes the A, the other makes changes in the B with the script and when the first user reopens the spreadsheet, he will see new values, but if he uses the values copying script, the range containing the values from importrange will show old values. Oddly enough, the script that copies values from that range will copy the new correct values even if we don't see them.
The problem goes away when I manually make some changes to spreadsheet B. I don't know, it's like spreadsheet B doesn't refresh when I make changes via script or something
Do you have any ideas what is the reason for this and maybe how to solve it. I think that I can get round this problem but I would not.
Two Google Sheets users might see diffent values on the same spreasheet because formula calculation (including those that make API calls like IMPORTRANGE) are triggered by user actions like opening or edited the spreadsheet.
Some function also might recalculated by changes made by scripts so it's actually possible that an script could "see" different values than those that are seeing by the users.
If you need that the users see the same values, should consider to periodically "freeze" them i.e. make a copy of the spreadsheet then replace the formulas by their results.
Another option is to share the screen rather than relaing on the "real time" collaboration feature of Google Sheets.

In google sheets is there any way to use importrange but maintain formatting? (no paid add-on)

In google sheets is there any way to use importrange but maintain formatting? Aware of SheetsGo but don't want a paid solution. Not referring to conditional formatting specifically, more row colors, etc.
You can't import formatting directly. But there is a simple solution, which I use all the time. For the sake of explanation, let's say your source spreadsheet is called "Source" and your destination spreadsheet is called "Destination." From there:
1.) Open Source and go to the sheet you want to have imported into Destination.
2.) Right-click on the tab that shows the sheet name. Choose Copy to > Existing spreadsheet. Use the search tool to find Destination. Click on that sheet.
3.) Open the Destination spreadsheet.The Source sheet will appear there, with the name "Copy of [sheet name]" and with all formatting from Source. Change the sheet name as you like. Then just click the upper-leftmost empty rectangle (between A and 1) to select the entire sheet and hit the Delete key. This will leave just your formatting. From here, you can now enter your IMPORTRANGE formula(s), and they'll populate without changing the formatting.
This might sound like a lot. But in actuality, it only takes 20 seconds to do.

Google sheets Named ranges not consistent between sheets

I have two similar spreadsheets that share code in an apps script library.
I use named ranges to access the sheets from the code.
In one spreadsheet the ranges are sheetname!range like this:
and the other spreadsheet just uses range:
I have tried copying both spreadsheets and tried recreating ranges to match the other format but nothing seems to work. I have looked for something that tells me that the spreadsheets are different versions but cant find anything that is different. I can make the code look for either format but.....
If you copy a worksheet in a spreadsheet with a Named Range, then Google Sheets has to do something, as you can't have two Named Ranges with the same name in the same spreadsheet. What it does is create new Ranges with worksheet-level scope of the form: newworksheet!existingnamedrange. So I think that probably explains how you got to where you are.
In terms of fixing it? You can just delete the newworksheet!existingnamedrange name and recreate existingnamedrange. As you can have the same name in different spreadsheets. Or am I misunderstanding the problem?