dde link change event macro not running

cicada

Board Regular
Joined
Jan 10, 2010
Messages
79
hi all i have the following code,

Private Sub Worksheet_Change(ByVal Target As Range)
Dim wks As Worksheet
If Intersect(Target, Range("J7")) Is Nothing Then Exit Sub

With ThisWorkbook.Sheets("HILO_TURBO")
Set wks = .Parent.Sheets("sheet1")
If .Range("E40").Value > 0 Then
Select Case Len(.Range("J7").Value)
Case 6
wks.Range("D3:D6").Value = .Range("J19:J22").Value
Case 10
wks.Range("G3:G6").Value = .Range("J27:J30").Value
Case 14
wks.Range("J3:J6").Value = .Range("J34:J37").Value
Case 18
wks.Range("M3:M6").Value = .Range("J41:J44").Value
Case 22
wks.Range("P3:P6").Value = .Range("J48:J51").Value
Case 26
wks.Range("D9:D12").Value = .Range("J55:J58").Value
Case 30
wks.Range("G9:G12").Value = .Range("J62:J65").Value
Case 34
wks.Range("J9:J12").Value = .Range("J69:J72").Value
Case 38
wks.Range("M9:M12").Value = .Range("J76:J79").Value
End Select
End If
End With
End Subwhen i test it manually it runs as desired however the data comes from an external dde link and therefore the change event does not fire. after some reading, apparently i need to use caluclate event and after some tweaking i couldnt get it to work. Could you advise how you would change the above to be a calculate event. Alternatively could i use setlinkondata method how would the code look using this method. any help greatly appreciated.

regards
Cicada
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,225,483
Messages
6,185,263
Members
453,284
Latest member
osy25

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top