View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
abxy[_68_] abxy[_68_] is offline
external usenet poster
 
Posts: 1
Default A question about Counting in VBA

Ok, i'm having a little trouble with this, can i get some help?

The following basically says that for every sheet in the workboo
(whose name in the current month), count how many cells in range H1 t
H275 have today's date:

count= 0

For Each wks In Workbooks(Format(Date, "mmmm") & ".xls").Worksheets
count = count + Application.CountIf(wks.Range("H1:H275"), Date)
Next


...that works absolutely fine. Now, i'm trying to make it say the sam
thing, except this time count the cell ONLY if the cell has today's AN
the offset(0, -4) of the cell's value is "PICK UP".

I can't seem to be able to put in that 'and' part to it. I only kno
how to do a countif with only one condition. but my problem is that
need a countif done with conditions for the count this time.

any help would be GREATLY appreciated, thanks much

--
Message posted from http://www.ExcelForum.com