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.

Formatear un Listbox automáticamente

publicado

Hola:

Os adjunto procedimiento para formatear un listbox de forma autómatica:

Supuesto de partida: Lista en A1 de Hoja1

Se toman de la fila 1:

.Fuente: Nombre, Tamaño, Negrita, Itálica

.Columnas: Numero, ancho

.Ancho lista: Sumatorio ancho columnas




Private Sub DimensionarListbox()

'Rango inicio cabecera lista
Sheets("Hoja1").Select: Range("A1").Select

'Fuente y tamaño
ListBox1.Font = ActiveCell.Font.Name
ListBox1.Font.Size = ActiveCell.Font.Size
ListBox1.Font.Bold = ActiveCell.Font.Bold
ListBox1.Font.Italic = ActiveCell.Font.Italic

'Dimensionamos el listbox
ListBox1.ColumnWidths = ""
Do Until ActiveCell = ""
ListBox1.ColumnCount = ActiveCell.Column
ListBox1.ColumnWidths = ListBox1.ColumnWidths & ";" & (6 * Columns(ActiveCell.Column).ColumnWidth) + 4
TotalWidth = TotalWidth + 6 * (Columns(ActiveCell.Column).ColumnWidth + 1)
ListBox1.Width = TotalWidth
ActiveCell.Offset(0, 1).Select
Loop

'Corregimos ancho columna
DoEvents
ListBox1.ColumnWidths = Mid(ListBox1.ColumnWidths, 2)

End Sub


[/CODE]

Saludos

Featured Replies

No hay posts para mostrar

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.