View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
CCManager[_3_] CCManager[_3_] is offline
external usenet poster
 
Posts: 1
Default IF THEN ELSE in VBA

What I am trying to do:
If the user has cell M3 selected, then change cell S8 to show the dat
in cell K57. If the user has cell M5 selected, change cell S8 to sho
the data in cell K58...and so on.

Here is what I have that is not working.

Sub FieldTip()
If ActiveCell.Value = ("M3") Then Range("S8").Value = ("K57")
Else: If ActiveCell.Value = ("M5") Then Range("S8").Value = ("K58")
Else: Range("S8").Value = " "
End If
End Sub

Any help would be greatly appreciated

--
Message posted from http://www.ExcelForum.com