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.

Macro de espacios y formato de fecha

publicado

buenos días amigos

tengo una macro con la cual limpio los espacios innecesarios en celdas, y en la misma otra que luego de borrar espacios coloca las columnas almacenadas en formato texto con formato numérico especificado, es para ver si ahi forma de agilizar y evitar bugs al momento de correrla.

Sub ESPACIOS()
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Application.EnableEvents = False
ActiveSheet.DisplayPageBreaks = False

With ActiveSheet.[A3:U7500]
.Value = Evaluate("if(row(" & .Address & "),clean(trim(" & .Address & ")))")

Range("D:D,E:E,G:G").Select
Selection.NumberFormat = "#,##0"
Columns("J:J").Select
Selection.NumberFormat = "#,##0.00"
Columns("A:A").Select
Selection.NumberFormat = "###0"


Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Application.EnableEvents = True
ActiveSheet.DisplayPageBreaks = True
Application.Calculation = xlCalculationAutomatic
End With
End With
End Sub[/CODE]

la macro primero limpia los espacios innecesarios de la data con:

[CODE]With ActiveSheet.[A3:U7500]
.Value = Evaluate("if(row(" & .Address & "),clean(trim(" & .Address & ")))")[/CODE]

y luego aplica formato numérico a ciertas columnas:

[CODE] Range("D:D,E:E,G:G").Select
Selection.NumberFormat = "#,##0"
Columns("J:J").Select
Selection.NumberFormat = "#,##0.00"
Columns("A:A").Select
Selection.NumberFormat = "###0"[/CODE]

gracias por su ayuda.

Featured Replies

publicado
  • Autor

adjunto el libro en el cual estoy trabajando, el tiene en la celda "a1" de color morado es para colocar un dato numerico o texto el cual con el boton filtrar hace un filtro de las columnas "E,G,K" dependiendo del criterio, el boton llamado borrar filtro hace lo que su nombre borrar el filtro, pero en el tercer boton llamado "Borrar Espacios" esta configurado a la macro "MACRO_TOTAL" que hace un llamado a las macros trabajadas aqui en dias anteriores, y a la macro en la cual estoy pidiendo la colsulta en el post #1

prueba maestro1.rar

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.