I have issue with change event in Excel Worksheet.
In my workbook I have several worksheet.
On first one I have two cells that I am using as parameters for my data source query at the same time when I change value in one of two cells I want to use that as trigger to pull date and time when this happened and put that on spreadsheet.
Here is code of Worksheet_Change event.
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("G4:G5")
If Not Application.Intersect(KeyCells, Range("G4:G5")) Is Nothing Then
' we will put time stamp in cell B5
Cells(5, "B").Value = Date & " " & Time
Cells(5, "B").NumberFormat = "m/d/yyyy h:mm AM/PM"
Event is fired only when I first time open workbook and change value in those two cells.
After that event is not fired data source is refreshed and I got new data in my spreadsheet but change event is not triggered for date time display.
What could be issue.