Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

638
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda