Saltar al contenido
View in the app

A better way to browse. Learn more.

Ayuda Excel

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Insertar ceros en campos vacios

publicado

Hola amigos.

a ver si alguien puede ayudarme con este asunto

tengo una matriz de datos en la q algunos de sus campos son nulos o vacios, en mi caso nulo = cero y por tanto kiero q inserte un cero en cada uno de esos campos.

tengo un codigo pero q en la segunda columna se para sin llegar a insertar los ceros hasta el ultimo registro...

alguien me puede ayudar???

os paso mi codigo...

Range("E1").Select

uf = Range("E65536").End(xlUp).Row

ActiveSheet.Range("E2:E" & uf).AutoFilter Field:=1, Criteria1:=""

Range("E2:E" & uf).Offset(, 0).SpecialCells(xlCellTypeVisible) = "0"

Range("E1").AutoFilter

Range("F1").Select

uf = Range("F65536").End(xlUp).Row

ActiveSheet.Range("F2:F" & uf).AutoFilter Field:=1, Criteria1:=""

Range("F2:F" & uf).Offset(, 0).SpecialCells(xlCellTypeVisible) = "0"

Range("F1").AutoFilter

Featured Replies

publicado

Hola fontvella

Sería mejor (recuerda las normas) que subas tu archivo. Yo he probado tu macro y en apariencia funciona bien.

Un saludo desde Vitoria

publicado

Hola de nuevo

Otra opción prescindiendo de los filtros podría ser

Sub Ceros()
ufE = Range("E65536").End(xlUp).Row
Range("E2:E" & ufE).SpecialCells(xlCellTypeBlanks) = "0"
ufF = Range("F65536").End(xlUp).Row
Range("F2:F" & ufF).SpecialCells(xlCellTypeBlanks) = "0"
End Sub[/CODE]

Y otra más, pero con cuidado si hay más columnas

[CODE]Sub Ceros()
Range("E2").Select
Range(Selection, ActiveCell.SpecialCells(xlLastCell)).SpecialCells(xlCellTypeBlanks) = "0"
End Sub[/CODE]

Un saludo desde Vitoria

publicado
  • Autor

ya, pero me peta el proxy al subir el archivo...

temas de seguridad de empresas...

Ok ioyama, pruebo tus propuestas...

publicado
  • Autor

Ok ioyama

lo he probado y el primer codigo para = q mi solucion

pero la segunda opcion la hace completa, pero se pera la macro al no detectar mas registros en los q poner cero. PERO LO HACE BIEN

asi q no se porq se peta pero gracias.

Saludos!!

Archivado

Este tema está ahora archivado y está cerrado a más respuestas.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.