Help with formula

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
 
S

Sanjay Valiyaveettil

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top