Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

127
Visualizações
Google sheet cell is only writen once instead of multiple times

I would like to make a visual random number genarator. That means in Cell F4 should random numbers shuffle trough until it stops with a random number. My Problem is now, that i can only see the last number generated and not the shuffeling.

function Wuerfeln() {

  var Upperbound = 60;
  var Lowerbound = 1;
  var i = Math.floor(Math.random() * (50 - 10 + 1) + 10);
  var RandomNummber = 0;
  var range = SpreadsheetApp.getActiveSpreadsheet().getRange("F4");

  while(i>0)
  {
    RandomNummber = Math.floor(Math.random() * (Upperbound - Lowerbound + 1) + Lowerbound);
    range.setValue(RandomNummber);
    i--;
    Utilities.sleep(200);
  };
};

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I would suggest you define a few things and then try it out until it looks like you want, or what you could do is create a pop up which shows a .gif of a dice.

The first approach would look like this

function wurfel(){
   const timeDelay = 200
   const numbersToShowUntilFinal = 20 // or do a random num

   // then your code here, 
   // but using the variables above to test around until you found a cool 

}

about 4 years ago · Juan Pablo Isaza Relatório

0

Google Sheets has a minimum refresh time, you're not going to make it change super fast by design.

Many requests from a script get batched together and run at the same time, so when the edits are all in the same cell you do not see them change and only the last one is displayed.

The only way to force a cell to change is using SpreadsheetApp.flush() as suggested by Sergey. This forces all pending sheet changes to be pushed. As you have noted however, this is slow.

To do this at all you would need to have an HTML dialog or sidebar which can run JavaScript that directly changes the HTML elements rather than a cell in the spreadsheet.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda