0

I want to write this into the range B1..

=split(A1," ")

(the delimiter is a space)

How do I do it using code?

I tried this...

 var splitCell = "=SPLIT(A1," ")";
 SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Sheet1").getRange("B1").setFormula(splitCell);

But the quotes are obviously ruinous. Therefore how are quotes handled in such instances?


EDIT

Sorry. Brain-fart.

var splitCell = '=SPLIT(A8," ")';

I thought that I had already tried that (about a million times) but when I just tried it (again) it worked no problem.

Thanks anyway

(I'm sure I'll be back with less smelly questions in the future)

Serge insas
  • 45,904
  • 7
  • 105
  • 131
5th4x4
  • 1,497
  • 8
  • 21
  • 27
  • You should have posted an answer instead of editing your question. This is not very helpful in this format. It looks like your question is unanswered. Which is bad for people searching for answered questions and those (like me) search to provide answers. – Henrique G. Abreu Apr 14 '13 at 14:47
  • Yes, I understand. I've corrected that now, although I was unable to do so at the time. – 5th4x4 Apr 16 '13 at 16:55

1 Answers1

0

At the time that I asked my question, I was not allowed to answer my own question (newbies here have limitations). However the answer to my question was stated in the "edited" part of my question.

I apologize for the confusion, but at the time I had no other options available to me, so therefore my question remained "Unanswered" even though I already resolved it.

Anyway, the answer is: var splitCell = '=SPLIT(A8," ")';

5th4x4
  • 1,497
  • 8
  • 21
  • 27