Quantcast
Channel: Excel Help Forum - Excel Programming / VBA / Macros
Viewing all articles
Browse latest Browse all 50236

VBA - Select one value in a list and mark another cell.

$
0
0
Good afternoon,

I'm trying to make a conditional statement in excel, but I'm not getting.

What I want is to select an option from a list, and depending on the value, I need to score or fill it u (with colors) another cell.

For example, on my list is the names Paid January, February Pago, Pago March, Do not Pay January, February Do not Pay, etc ...

I want that when I select the option in January Paid for example, I select another cell (which corresponds to the value of January) in green, and if I check the "Not paid Janeiro" he said check the cell red.

I tried that but it did not work here ...

Code:

Sub SE()
'
' SE Macro
'
  If Range("O22").Cells = ("AB22") Then 'AB22 é a célula onde contém os valores das listas'
        Range("C22").Select
        ActiveCell.Interior.Color = 5287936
                         
    End If
   
End Sub

I've attached an example just to help and make it easier. THANKSSS!!

Formatação condicional_help.xlsx

Viewing all articles
Browse latest Browse all 50236

Trending Articles