Tweeking formula

R

Richard

Some problems arise with my procedure. It works fine
copying from sheet1 to sheet 2 and then counting. But when
I use advanced filter and filter (unique items)on Sheet2
my formula for counting quits working when I add (new)
numbers. It still counts for the ones already there but
not any new ones added.
Problem 2: When I first enter something in Sheet1, Column
A cell 3, it copys it to Sheet2 Column A cell 4, Why? I
need it to copy to Sheet2 Column A cell 3.
Thanks in advance!!!
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 1 Then
Application.Calculate
Sheet2.UsedRange.SpecialCells(xlCellTypeLastCell)(2,
1).EntireRow.Resize(1, 9) = Target.EntireRow.Resize(1,
9).Value
End If
End Sub
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 >= 1 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
 
D

Don Guillett

I didn't look at all of this but you may only have ONE change event per
sheet module. If both of these are on the same sheet, combine.
 

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