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

206
Vistas
How do you put a value in a similar key over and over again in javascript

I want to receive the Excel data and put the value in the Excel column as a loop statement.

I want to put it in with the code below, what should I do?


//read file
const workbook = XLSX.readFile("test.xlsx");

//put value
workbook.Sheets.Sheet1.B2.v = 2000
workbook.Sheets.Sheet1.B3.v = 3000
workbook.Sheets.Sheet1.B4.v = 4000
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use bracket notations along with a for loop to do this.

With [] notation, you can use a variable to access a property of an object.

Initialize with a suitable value and run up til some limit. Here is sample code:

const workbook = XLSX.readFile("test.xlsx");
let cellsLimit = 100;
for(let i = 1 ; i <= cellsLimit; i++){
let keyName = 'B' + i;
workbook.Sheets.Sheet1[keyName].v = 1000 + (i*1000)
}
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