Don't really understand the question. Do you mean that you are recording code
but the recorded code does not work with Autofill?
Dear OssieMac
Thank you for replying my problem is :
This the code
If Target.Column = 3 Then
If Selection.Count > 1 Then Exit Sub
Target.Offset(0, -1).Formula = "=Row()-1"
If Target = "" Then Target.Offset(0, -1) = ""
End If
End Sub
Now if you fill C1, C2 manually with number 1 ,2 you can see the result on
B1,B2 it is 0,1 now everything is OK so far but if you auto fill
C3,C4,C5……..you can not see any result on B3,B4,B5……….also if you make C7 =
F4 and you fill F4 with any number say 10 you can see your number 10
automatically on C7 but no result on B7 which mean the code is not respond .
Thank you
forcast
> Don't really understand the question. Do you mean that you are recording code
> but the recorded code does not work with Autofill?
[quoted text clipped - 3 lines]
> > the code work with the auto fill.
> > Thank you.
Dave Peterson - 24 Mar 2008 13:23 GMT
Maybe...
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myRng As Range
Dim myCell As Range
Set myRng = Intersect(Target, Me.Range("C:C"))
If myRng Is Nothing Then
Exit Sub
End If
For Each myCell In myRng.Cells
If myCell.Value = "" Then
myCell.Offset(0, -1).Value = ""
Else
myCell.Offset(0, -1).Formula = "=Row()-1"
End If
Next myCell
End Sub
> Dear OssieMac
> Thank you for replying my problem is :
[quoted text clipped - 25 lines]
> > > the code work with the auto fill.
> > > Thank you.

Signature
Dave Peterson
forcast - 24 Mar 2008 15:00 GMT
Dear Dave Peterson
Thank you very much It is excellent solution .
Regards
Forcast
> Maybe...
>
[quoted text clipped - 48 lines]
> > > > the code work with the auto fill.
> > > > Thank you.