Tim Hanson
Member
I have all my Macros in a .xlsm workbook and they act on a 2nd open .xlsx worxbook
I need to run a macro on cell change within a range (cells in column A) in the .xlsx file on sheet(2)
Is it possible to do this from the 1st .xlsm workbook?
I found many variations of the macro below but they all need the code to be placed in the Sheet of the column with the cells that change, which is a .xlsx file not a .xlsm file
Thanks for any help on this
I need to run a macro on cell change within a range (cells in column A) in the .xlsx file on sheet(2)
Is it possible to do this from the 1st .xlsm workbook?
I found many variations of the macro below but they all need the code to be placed in the Sheet of the column with the cells that change, which is a .xlsx file not a .xlsm file
Thanks for any help on this
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("A1:C10")
If Not Application.Intersect(KeyCells, Range(Target.Address)) _
Is Nothing Then
' Display a message when one of the designated cells has been
' changed.
' Place your code here.
MsgBox "Cell " & Target.Address & " has changed."
End If
End Sub