Help with formula

  • Thread starter Thread starter Richard
  • Start date Start date
R

Richard

Can some one help me get this right. Trying to get this
formula to start in column b row 3 and continue down.
Somethings not working as usual.
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim lngRow As Long
Application.EnableEvents = False
lngRow = Cells(65536, 1).End(xlUp).Row
If lngRow >= 2 Then
Worksheets("Sheet2").Range("B3").Formula = "=countif
(Sheet1!A$3:A$2000,A3)"
Worksheets("Sheet2").Range("B3:B" & lngRow).FillDown
End If
Application.EnableEvents = True
End Sub
 
Your code works fine.

A few points:
1. The cell you are changing should be on or below the
2nd row.
2. Only cells upto the row number you are on gets
refreshed
3. The formula of B3 gets changed only on sheet2.

what did you intend it to do?

regds
sanjayva at yahoo dot com
 
Back
Top