IF command

  • Thread starter Thread starter Brian Engle
  • Start date Start date
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
 
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
 
Back
Top