I have a spreadsheet set up in testing right now that has a macro to send the current sheet in an email. The macro works perfectly. What I am trying to figure out is how to automatically run this macro. I have a dde connection setup to a plc. The code I'm attempting to use is-
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$A$2"
Call Mail_ActiveSheet
Case Else
End Select
End Sub
In Cell A1 I have =RSLINX|Print!'F8:0' (its a 0 or 1). Initially I was trying to watch this data in cell A1 to run the macro. I'm a beginner with VBA... It will not work to watch A1, I'm assuming because =RSLINX|Print!'F8:0' isn't actually changing. My last attempt was to copy cell A1 with =VALUE(A1) to A2 and have the worksheet_change watch cell A2. This is where I'm stuck. All of the code executes if I manually change the value in A2 by typing it. Any suggestion would be greatly appreciated.
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Select Case Target.Address
Case "$A$2"
Call Mail_ActiveSheet
Case Else
End Select
End Sub
In Cell A1 I have =RSLINX|Print!'F8:0' (its a 0 or 1). Initially I was trying to watch this data in cell A1 to run the macro. I'm a beginner with VBA... It will not work to watch A1, I'm assuming because =RSLINX|Print!'F8:0' isn't actually changing. My last attempt was to copy cell A1 with =VALUE(A1) to A2 and have the worksheet_change watch cell A2. This is where I'm stuck. All of the code executes if I manually change the value in A2 by typing it. Any suggestion would be greatly appreciated.