count value in column and VBA
Hi all:
I hope you can help with the following: How do I write a macro that would count the number of cells in column (column 19) that has a "NO" then I want excel to go to the last row and insert "Total count" i column R and the # of cells with a "NO" in column S, Is it possible to do this with a macro? thanks for helping Richard -- Message posted from http://www.ExcelForum.com |
count value in column and VBA
This should do it.
Sub test() Dim i As Long i = Range("S65536").End(xlUp).Row Range("R" & i + 1).Value = "Total count" Range("S" & i + 1).Value Application.WorksheetFunction.CountIf(Range("S1:S" & i), "=No") End Sub -- Message posted from http://www.ExcelForum.com |
All times are GMT +1. The time now is 04:58 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com