Numeración por color

ColdGeorge

Active Member
Joined
Aug 21, 2012
Messages
395
Office Version
  1. 2016
Platform
  1. Windows
Buenos días

En el rango B3:B43 tengo una lista de nombres, algunos de ellos están en rojo (font, color).

Solicito ayuda para crear en la columna A la numeración necesaria (1,2, 3, etc.) para los los nombres en B que están en rojo.

Gracias por su ayuda, ColdGeorge
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Buenos Dias,

Lo mas facil es de usar la misma lógica para determinar las celdas en rojo ...para la numeración ...
 

ColdGeorge

Active Member
Joined
Aug 21, 2012
Messages
395
Office Version
  1. 2016
Platform
  1. Windows
Hola amigos

Estoy experimentando con este código:

Code:
Dim cell As Range
For Each cell In Sheets("literaturapuntual").Range("B3:B44")
If cell.Font.Color = vbRed Then
cell.Offset(0, -1).Value = 1
End If
Next cell

Pero no numera en la columna A los registros que están con letras rojas en la columna B.

Gracias de antemano, ColdGeorge.
 

James006

Well-known Member
Joined
Apr 4, 2009
Messages
3,680
Hola,

Con una pequeña modificacion ...

Code:
Sub RojoNum()
Dim cell As Range
Dim i As Integer
  For Each cell In Sheets("literaturapuntual").Range("B3:B44")
    If cell.Font.Color = vbRed Then
        i = i + 1
        cell.Offset(0, -1).Value = i
    End If
  Next cell
End Sub

Espero que ajude ... :wink:
 

ColdGeorge

Active Member
Joined
Aug 21, 2012
Messages
395
Office Version
  1. 2016
Platform
  1. Windows
Hola James006

Gracias, con tu ayuda pude alcanzar mi objetivo, y aprender algo nuevo, saludos.

ColdGeorge
 

Watch MrExcel Video

Forum statistics

Threads
1,132,685
Messages
5,654,747
Members
418,149
Latest member
amamiche67

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top