coliervile
02-16-2008, 01:22 PM
"XLD" HELP! :help The following worksheet tracks the vacation request for employees. I've accomplished this with the help from "XLD". I've run into one problem...it seems when I added this macro to the worksheet, "Leave Request"...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
For Each Cell In Target
With Cell
If .Column = Range("A:A").Column Then
Cells(.Row, "B").Value = Format(Now, "dd mmm yyyy hh:mm:ss")
End If
End With
Next Cell
If Not Intersect(Target, Me.Range("B:B", "E:E")) Is Nothing Then
Me.Columns("A:E").Sort key1:=Me.Range("D2"), order1:=xlAscending, _
key2:=Me.Range("B2"), order2:=xlAscending, _
header:=xlYes
End If
End Sub
and new data is added to in between two existing rows from the userform onto the worksheet the "End" date doesn't go into column "E". The "End" date in column "E" remains empty or blank. It only seems to happen when new data is added and goes between data that's already on the worksheet. When "CC" was added to the worksheet from the user form and it was placed in between "AA" and "BB" the "End" date didn't go into column "E".
It's frustrating that I can't figure out where there conflict is restricting the "End" date from downloading into column "E". :banghead: :banghead: :banghead:
You're help is appreciated,
Charlie
</IMG></IMG></IMG></IMG>
Private Sub Worksheet_Change(ByVal Target As Range)
Dim Cell As Range
For Each Cell In Target
With Cell
If .Column = Range("A:A").Column Then
Cells(.Row, "B").Value = Format(Now, "dd mmm yyyy hh:mm:ss")
End If
End With
Next Cell
If Not Intersect(Target, Me.Range("B:B", "E:E")) Is Nothing Then
Me.Columns("A:E").Sort key1:=Me.Range("D2"), order1:=xlAscending, _
key2:=Me.Range("B2"), order2:=xlAscending, _
header:=xlYes
End If
End Sub
and new data is added to in between two existing rows from the userform onto the worksheet the "End" date doesn't go into column "E". The "End" date in column "E" remains empty or blank. It only seems to happen when new data is added and goes between data that's already on the worksheet. When "CC" was added to the worksheet from the user form and it was placed in between "AA" and "BB" the "End" date didn't go into column "E".
It's frustrating that I can't figure out where there conflict is restricting the "End" date from downloading into column "E". :banghead: :banghead: :banghead:
You're help is appreciated,
Charlie
</IMG></IMG></IMG></IMG>