Excel cell data not updating until i press enter

Copper Contributor
 

i am using stock market software which supports export live data to excel.  Now i want capture all the volume and price tick shown in excel to be copied in new sheet for further analysis how can i do this.  pls help i am used this code but i need to press enter everytime.

 

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("A:A")) Is Nothing Then

ActiveCell.Offset(-1, 0).Activate

a = Sheets("Sheet2").Cells(Rows.Count, ("A")).End(xlUp).Row + 1

Sheets("Sheet2").Range("A" & a).Value = ActiveCell.Value

ActiveCell.Offset(1, 0).Select

Else

If Not Intersect(Target, Range("B:B")) Is Nothing Then

ActiveCell.Offset(-1, 0).Activate

b = Sheets("Sheet2").Cells(Rows.Count, ("B")).End(xlUp).Row + 1

Sheets("Sheet2").Range("B" & b).Value = ActiveCell.Value

ActiveCell.Offset(1, 0).Select

End If

End If

End Sub

0 Replies