counting cells

  • Thread starter Thread starter Robert Couchman
  • Start date Start date
R

Robert Couchman

Hello all,

i am curently looking for a piece of code that will look
at all cells in a column and count the number of cells
that contain the value "2" then display this result in my
textbox on a form "tb1"

this is to be used for stats so i will need this in VB
form as it will need to be updated every time stats is run.

Thank you,

Robert Couchman
([email protected])
 
Hi Robert,

Private Sub UserForm_Activate()
tb1.Text =
CStr(WorksheetFunction.CountIf(Worksheets("Sheet1").Range("A:A"), 2))
End Sub


--

HTH

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