![]() |
counting cells
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 ) |
counting cells
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) "Robert Couchman" wrote in message ... 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 ) |
counting cells
Cheers Bob,
Code worked perfect, now i actually have a working stats sheet! Thankyou, Robert Couchman ) |
All times are GMT +1. The time now is 02:11 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com