Sub CopyAboveRow()
Dim sRng As Range
Dim iRow As Integer
Dim iCol As Integer
Set sRng = Range("A2:F5")
Range("A2").Select
For iRow = 2 To 5
For iCol = 1 To 5
If Cells(iRow, iCol).Value = "Do" Then
Cells(iRow, iCol).Select
ActiveCell.Value = ActiveCell.Offset(-1, 0).Value
End If
Next iCol
Next iRow
End Sub
Hi Kaiser,
Try putting this in worksheet:
Code:Private Sub Worksheet_Change(ByVal Target As Range) If Target.Value = "Do" Then Target.Value = Target.Offset(-1, 0) End Sub
See attached file also.
Hi Kaiser,
Try putting this in worksheet:
Code:Private Sub Worksheet_Change(ByVal Target As Range) If Target.Value = "Do" Then Target.Value = Target.Offset(-1, 0) End Sub
See attached file also.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo HandleError
If Target.Value = "Do" Then Target.Value = Target.Offset(-1, 0)
Exit Sub
HandleError:
Err.Clear
End Sub
Thanks vijay,
I was just experimenting..
Here is a little improved one, previous was giving error when i tried to delete multiple cells selected.
Code:Private Sub Worksheet_Change(ByVal Target As Range) On Error GoTo HandleError If Target.Value = "Do" Then Target.Value = Target.Offset(-1, 0) Exit Sub HandleError: Err.Clear End Sub
@Kaiser
Please download and replace the code.