IF command

B

Brian Engle

Can anyone tell me how to write properly this function. I
need the know how to write "=if a1 = 5 then goto c1",
this is just an example but for the life of I can't get
it work. I wrote queries in Lotus several years ago, but
excel is a different animal.

regards,
Brian
 
P

Peo Sjoblom

You can't do that with a function you would need a sheet event macro


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$A$1" And Target.Value = "5" Then
Range("C1").Select
End If
End Sub

right click the sheet tab and select view code and paste in the above

press Alt + Q to close the VBA editor and save the workbook. Now type in 5
in A1 and press enter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top