Count result output to other sheet

P

pauluk

Hi People,

What i require is the results i get from the below code to be place i
sheet2.

So when the count says 13 of 42 the number 13 is placed in cell A4 i
sheet2

'--------------------------------------------------------------------------------

Dim rng As Range
Dim strStart As String

Sheets("Telephone Stats").Select

Set rng = ActiveSheet.AutoFilter.Range

strStart = InputBox("Please enter start date, (dd/mm/yyyy)", "Extrac
Maker: Start Date")
Selection.AutoFilter Field:=7, Criteria1:=">="
CLng(CDate(strStart)), Operator:=xlAnd, _
Criteria2:="<=" & CLng(CDate(strStart))

MsgBox rng.Columns(1). _
SpecialCells(xlVisible).Count - 1 _
& " of " & rng _
.Rows.Count - 1 & " Records"

ActiveSheet.ShowAllData

Sheets("Manager Checks").Select

'-------------------------------------------------------------------------------

Regards
Pau
 
B

Bob Phillips

add

Worksheets("Sheet2").Range("A4").Value = Columns(1). _
SpecialCells(xlVisible).Count - 1

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
P

pauluk

Bob thanks for this but one problem now.

Instead of the value in the cell being say 4 it is given me th
following 65521

Can you help
 
B

Bob Phillips

Sorry, missed a bit. Try this instead


Worksheets("Sheet2").Range("A4").Value = rng.Columns(1). _
SpecialCells(xlVisible).Count - 1

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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