function if - true copy cell and glue in another

Asked

Viewed 150 times

2

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

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

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

  • 5

    If you enter the formula in the cell G10 it’s easy: =SE(F10=O11;G10;"falso")

1 answer

2

Really the method passed by Ricardo Pontual in the commentary 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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.