function if - true copy cell and paste in another

2

I need a little help. I have an excel sheet and I want to do the following: In this function

= SE(F10=O11;Copia valor celula G2 e cola na celula G10;"falso")

I want to make a comparison and if true copy the value of cell G2 and paste in cell G10.

    
asked by anonymous 23.05.2018 / 13:10

1 answer

2

Actually the method passed by Ricardo Pontual in the comment is easier.

But if you really need a VBA, use

Sub se_condicao()

If Range("F10").Value = Range("O11").Value Then
   Range("G2").Copy Range("G10")
End If

End Sub
    
23.05.2018 / 14:29