ravikr2678
07-16-2009, 03:39 PM
Hello team,
I'm working with a macro which runs at change of cell values.
eg: if i enter some value in cell D10 and hit enter then the macro runs.
however, I have a situation where the value in to cell D10 comes from a link.
i mean, input from another application.
So hitting on enter key after value with in D10 changes is not possible.
due to which the macro do not run.
Below is the code.
Private Sub Worksheet_Activate()
UpDates
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C10:D10")) Is Nothing Then
UpDates
End If
End Sub
Private Sub UpDates()
Dim TgtRow As Long, i As Long
Application.EnableEvents = False
TgtRow = 10
For i = 2 To TgtRow - 1
If Cells(i, 1) = Cells(TgtRow, 1) Then
Cells(TgtRow, 1).EntireRow.Copy Cells(i, 1)
End If
Next
Application.EnableEvents = True
End Sub
Is there any way that the macro can run without hitting enter key for D10 ?
I'm working with a macro which runs at change of cell values.
eg: if i enter some value in cell D10 and hit enter then the macro runs.
however, I have a situation where the value in to cell D10 comes from a link.
i mean, input from another application.
So hitting on enter key after value with in D10 changes is not possible.
due to which the macro do not run.
Below is the code.
Private Sub Worksheet_Activate()
UpDates
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("C10:D10")) Is Nothing Then
UpDates
End If
End Sub
Private Sub UpDates()
Dim TgtRow As Long, i As Long
Application.EnableEvents = False
TgtRow = 10
For i = 2 To TgtRow - 1
If Cells(i, 1) = Cells(TgtRow, 1) Then
Cells(TgtRow, 1).EntireRow.Copy Cells(i, 1)
End If
Next
Application.EnableEvents = True
End Sub
Is there any way that the macro can run without hitting enter key for D10 ?