A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

count value in column and VBA



 
 
Thread Tools Display Modes
  #1  
Old July 6th 04, 06:11 PM posted to microsoft.public.excel.programming
RichardO[_14_]
external usenet poster
 
Posts: 1
Default 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

Ads
  #2  
Old July 6th 04, 06:57 PM posted to microsoft.public.excel.programming
kkknie[_157_]
external usenet poster
 
Posts: 1
Default 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

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to count#cells w/= value in other column and not count blank c aganoe Excel Worksheet Functions 4 April 9th 10 11:36 AM
Count Unique Values in 1 Column based on Date Range in another Column Brian Excel Worksheet Functions 14 May 17th 09 02:58 PM
Count Intervals of 1 Numeric value in a Row and Return Count down Column Sam via OfficeKB.com Excel Worksheet Functions 8 October 4th 05 04:37 PM
Count Intervals of Filtered TEXT values in Column and Return Count across a Row Sam via OfficeKB.com Excel Worksheet Functions 9 July 31st 05 03:37 AM
COUNT INFORMATION IN COLUMN B ONLY IF A1 MATCHES K1 COUNT THAT CE. witchcat98 Excel Worksheet Functions 1 February 4th 05 01:38 PM


All times are GMT +1. The time now is 05:38 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright 2004-2014 ExcelBanter.
The comments are property of their posters.