Hi,
I have a change event on a sheet to change certain cell values when another cell changes. The problem is it is not working when I drag down that cell, for instance the numbers I am entering in the trigger cell are sequential, so when I drag them down to auto fill, the other cells do not change. Anyone know how to fix this? I tried to find an answer and thought this would work but it doesn't
Here is my code:
I have a change event on a sheet to change certain cell values when another cell changes. The problem is it is not working when I drag down that cell, for instance the numbers I am entering in the trigger cell are sequential, so when I drag them down to auto fill, the other cells do not change. Anyone know how to fix this? I tried to find an answer and thought this would work but it doesn't
VBA Code:
Application.CellDragAndDrop = True
Here is my code:
VBA Code:
Dim xCellColumn As Integer
Dim xTimeColumn As Integer
Dim xWorkColumn As Integer
Dim xMachColumn As Integer
Dim xEndColumn As Integer
Dim xShiftColumn As Integer
Dim xRow, xCol As Integer
Dim xDPRg, xRg As Range
xCellColumn = 3
xTimeColumn = 7
xWorkColumn = 1
xMachColumn = 2
xEndColumn = 4
xShiftColumn = 6
xRow = Target.Row
xCol = Target.Column
If Target.Text <> "" Then
If xCol = xCellColumn Then
Cells(xRow, xTimeColumn) = Now()
Cells(xRow, xWorkColumn) = Range("K1").Value
Cells(xRow, xMachColumn) = Range("E1").Value
Cells(xRow, xEndColumn) = Range("E2").Value
Cells(xRow, xShiftColumn) = Range("E3").Value
Else
On Error Resume Next
Set xDPRg = Target.Dependents
For Each xRg In xDPRg
If xRg.Column = xCellColumn Then
Cells(xRg.Row, xTimeColumn) = Now()
End If
Next
End If
End If
End Sub