in this video we're going to talk about issues you may face when you use import range function
to get data from different spreadsheets and how you can actually address those so for example
if we have this spreadsheet with this data if we wanted to grab some of this data and
move it to this spreadsheet right here we would have used import range function so what i would
do here i would do equals import range and then we need to follow this by the url of
the spreadsheet in quotes so i'll do double quotes here go to this other spreadsheet copy this link
and paste it right here and then we followed by a comma and then we have to do the range as string
so if we do double quotes here we need to refer to a range of cells we want to basically extract
from the other spreadsheets so we want to start with the name of the tab so here if
we look at this data the name down here is transactions so we're going to type transactions
exclamation sign and then we're going to follow that by the range
and the range is going to be let's say we want to grab
this column b and then also this column f so for now let's get column b so that would be b1
colon all the way down so i'm going to go ahead and do b1 colon b now if you wanted to go to a
particular range let's say four rows going down you would type b4 but i want to go to a whole
column so i'll just do this remove the end and hit enter and what's going to happen now it's going to
ask me to give access to that spreadsheet so if i click on this see allow access and now i was
able to get that column b here now say i also wanted to get the sales amounts from f column
so i could just simply now copy this hit escape go back and paste it here and replace this b with f
now if you want to get multiple columns you can do multiple columns here in your range for now
i'll do this hit enter now this is great now one of the issues that you may have with import range
is when you have this spreadsheet you may or may not want people who access this spreadsheet
to be able to see the data on this spreadsheet so you may want them to be able to see the sales
and sales rep data but it's possible that you don't want them to be able to access cost of goods
sold data now if you just share the spreadsheet if they have added access anybody could just go here
and update these ranges to anything they want so they could go from f through g hit enter
and now you get access to pretty much anything you want from the other spreadsheet
so for that reason if we want to limit the access to a particular
part of this what we're going to do we're going to use this as an intermediate spreadsheet so
what we'll do we'll simply just go here and rename this tab i'll just call this whatever
you want to call it you can call it the same transactions if you want but i'll just go
ahead and name it something else so you can see the difference so i'll just call it sales data
and now what we're going to do we're going to basically create another spreadsheet
this is the one we're going to share and on this one i'm going to do another import range
from here so what i'll do i'll do import range
again spreadsheet url in code so this time it's going to be
this spreadsheet so we'll copy that go here and paste
comma then we do range as string again so this time the name of the tab was
sales data exclamation sign so that's this sales data worksheet right here and the range
is going to be from a1 through b all the way down so i'll do a1 colon b and if i hit enter
again we're gonna have to give access to that so now we give access and we can share this
spreadsheet but now even if we go and change the range in this one to any other column it doesn't
really matter because in this spreadsheet that's pretty much all the info we have
so by using the spreadsheet in the middle we basically restrict access to the rest of our data
that's coming from the original data spreadsheet so that's one reason to do this and the second
reason to do this is once you allow access to a spreadsheet there is really no way to disallow
access at least at this point of time so this is why having the spreadsheet in the middle
is again a good idea because now i could basically just go ahead and delete this spreadsheet in the
middle if i wanted to and that way it will disallow access to that data and i don't
have to touch my actual source spreadsheet so that's a little bit about import range and that
should do it for this video thanks for watching please subscribe and i'll see you in the next one