I need not only to import the data from a cell, but also the cell background color. I've found ways to import color, but it's usually on a 1:1 basis (for example A1 color from the source gets copied to A1 on the destination). My particular need won’t be 1:1.

The destination sheet is a pared down version of the master sheet. I will be setting the IMPORTRANGE function on individual cells. For example, I set the IMPORTRANGE on B154 to import AG5 on the source. I need the data to be imported and also the cell background color.

My "source" spreadsheet is fairly complex and manages the flow of my entire business. We are a small hotel and the source spreadsheet contains data about reservations and financials. I created a second spreadsheet (“destination”) which is very simple and contains only one sheet and five columns (one is the date and the remaining four represent each of our guest rooms) and 366 rows — representing each day of the year (leap year).

The basic purpose of the destination sheet is so the service staff can check it on an ongoing basis and know the reservation schedule and know when a room needs to be reset. IMPORTRANGE is the perfect solution for this and I’ve already set it up. BUT in addition to the data being imported, I also need the cell color. As you will see in the images below, the color represents the duration of the guest stay.






This could no be get done directly by using built-in functions only. IMHO the straightforward solution involves the use of Google Apps Script, more specifically the copyTo method with options.

  • ok I read though that and it seems that getBackgrounds() can potentially get me going. How exactly would I implement it on the source and destination pages – Steven Galvano Jun 24 '17 at 14:21
  • That method could be used but I think that your code end with more calls to the GAS services making it slower. The question doesn't include enough information to know if the performance difference could be significant. – Rubén Jun 24 '17 at 14:25
  • I can offer more information... what exactly would be important? – Steven Galvano Jun 24 '17 at 15:58
  • On a broad sense, first, bear in mind that this is not a place to request that others write code for you. For further details follow the tour and checkout How to Ask. For a question like this, the question should include enough information to describe the problem and the relevant OP concerns and "roadblocks", that could be among other things, the number of cells that will be imported, if you have cells that are side by side (that could handled as range instead of individually), how often the updates should be done, if you already wrote a script, a minimal complete and verifiable example,...) – Rubén Jun 24 '17 at 16:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.