A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
right click on the sheet tab where you want this behavior.
in the resulting module put in code like this:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$1" Then
If Len(Trim(Target.Value)) <> 0 Then
Target.Offset(0, -1).Formula = "=kepdde|_ddedata!Channel1.M340." & Target.Value
End If
End If
End Sub
this will fire each time a cell changes. It checks if the cell that triggered the event (changed) is cell B1. In otherwords, you just typed Int_1 in cell B1. It will then put the formula
=kepdde|_ddedata!Channel1.M340.Int_1 in cell A1 if B1 contains the value Int_1
when the Change event is fired, the parameter "Target" holds a range reference to the cell(s) that triggered the event. So the first thing is to check if cell B1 triggered the event. Then check if B1 is not empty. If it passes those two tests, it assumes that B1 has a valid value to describe a legitimate Item for you server and it builds the DDE formula.
if you get prompted that this is a dangerous operation, you might try adding:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$1" Then
If Len(Trim(Target.Value)) <> 0 Then
Application.DisplayAlerts = False
Target.Offset(0, -1).Formula = "=kepdde|_ddedata!Channel1.M340." & Target.Value
Application.DisplayAlerts = True
End If
End If
End Sub
if that doesn't suppress the message, then you are out of luck in terms of suppressing the message.
You can of course change the $B$1 to a cell in your tag column. If you wanted to work on cells say B2:B30 in your tag column you could alter the code to
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("B2:B30")) Is Nothing Then
If Len(Trim(Target.Value)) <> 0 Then
Application.DisplayAlerts = False
Target.Offset(0, -1).Formula = "=kepdde|_ddedata!Channel1.M340." & Target.Value
Application.DisplayAlerts = True
End If
End If
End Sub
--
Regards,
Tom Ogilvy