VBA - WorkSheet Change ByVal Target As Range and DDE link RRS feed

  • Pergunta

  • Hi, I´ll be gratefull if someone could help with this problem; when the value of a cell changes, do something, but my macro is not working when the value is related with the value of a cell of DDE link.


    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim KeyCells As Range

    Set KeyCells = Sheets("Sheet1").Cells(1, 1)

    If Cells(1, 1) <> Sheets("Sheet1").Cells(1, 2) Then

    Sheets("Sheet1").Cells(1, 2) = Sheets("Sheet1").Cells(1, 1)

    MsgBox "Cell" & Target.Address & "has changed."
    End If
    End Sub
    • Editado from water quinta-feira, 24 de outubro de 2013 13:30
    quinta-feira, 24 de outubro de 2013 13:28


  • I don't know if you are from Brazil or not, since this is a portuguese Brazil/Portugal forum. If that's the case, feel free to post your questions in portuguese.

    DDE links, instead of a Worksheet_Change event being generated, it will generate a Worksheet_Calculate event. So, try trapping this event.

    Felipe Costa Gualberto -

    sexta-feira, 25 de outubro de 2013 01:06