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.

Rellenar celdas con colores alternos

publicado

Hola:

Sub ColorearMeses()
For i = 1 To 12
Cells(1, Columns.Count).End(xlToLeft).offset(0,1).Offset(0, -i).Select
ActiveCell.Interior.ColorIndex = 4
Next i
End Sub[/CODE]

Esta macro recorre las columnas de una fila hacia atrás (izquierda) rellenándo cada celda con el color indicado. Pero todas quedan del mismo color.

Quisiera que cada celda la rellenara alternativamente con dos colores más, por ejemplo (6 y 44). Es decir:

para i = 1, color =4

para i=2, color =6

para i = 3, color = 44

para i = 4, color [b]4 [/b](se repite el ciclo),

El archivo está como quiero que quede.

Saludos.

Color.rar

Featured Replies

publicado
Sub ColorearMeses()
For i = 1 To 12
Cells(1, Columns.Count).End(xlToLeft).offset(0,1).Offset(0, -i).Select
Select Case i Mod 3
Case 0: ActiveCell.Interior.ColorIndex = 6
Case 1: ActiveCell.Interior.ColorIndex = 4
Case 2: ActiveCell.Interior.ColorIndex = 44
End Select
Next i
End Sub[/CODE]

publicado
  • Autor

Es lo que quería. Muchas gracias.

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.