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

648
Visualizações
How do I uppercase an entire sheet in Office Scripts Excel (Typescript)?

I was able to do the below in VBA and need to transfer my script to Office Scripts in Excel 365. I can't figure out how to do the whole sheet and not just a string.

This is what I used in VBA:

Dim rng As Range
Set rng = Selection
For Each cell In rng
cell.Value = UCase(cell)
Next cell
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

This worked for me, could be a little cumbersome with a lot of cells but should still work.

function main(workbook: ExcelScript.Workbook, worksheetName: string)
{
  let worksheet = workbook.getWorksheet(worksheetName);
  
  // Ge tthe Used Range on the given worksheet and all values.
  let usedRange = worksheet.getUsedRange(false);
  var values = usedRange.getValues();

  // Now loop through each cell and upper case it.
  for (var row = 0; row < values.length; row++) {
    for (var col = 0; col < values[row].length; col++) {
      values[row][col] = values[row][col].toString().toUpperCase();
    }
  }

  usedRange.setValues(values);
}

Note: There is a parameter to the function so it is expected to be used via PowerAutomate/LogicApps but if you don't want that then you should be able to change it up to use the active sheet with relative ease.

e.g. ...

function main(workbook: ExcelScript.Workbook)
{
  let worksheet = workbook.getActiveWorksheet();

  ... continue the rest of the code here ...
}
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