LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default IF THEN ELSE in VBA

Sub FieldTip()
If ActiveCell.Address = "$M$3" Then
Range("S8").Value = Range("K57").Value
ElseIf ActiveCell.Addess = "$M$5") Then
Range("S8").Value = Range("K58").Value
Else
Range("S8").Value = " "
End If
End Sub

How many cells does "so on" refer to?



--
Regards,
Tom Ogilvy


"CCManager " wrote in message
...
What I am trying to do:
If the user has cell M3 selected, then change cell S8 to show the data
in cell K57. If the user has cell M5 selected, change cell S8 to show
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/



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:03 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"