LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel VBA - Countif problem

Dim x As Long, y As Long, z As Long, searchstring As String
If ActiveCell = "" Then Exit Sub
searchstring = "DS45"
x = Range("I65536").End(xlUp).Row
y = Application.WorksheetFunction.CountIf(Range("I:I") , searchstring)
If y 3 Then
MsgBox "This Customer has reached their limit. Only 3 DVD's allowe
per customer!" & vbCrLf & vbCrLf & "Mark Smith - Manager"
vbInformation + vbOKOnly, "Disc Emporium - DVD Limit Check"
ActiveCell = ""
ActiveCell.Offset(, 5) = "On shelf"

I have the above formula which checks the search string for a value o
more than 3 entries, then brings up a message box...But, this work
fine, however, I have other strings that also needed to be checked..Ho
can I get the code to check more than one besides the "DS45"...I hav
20 or so more numbers in my datebase that I would like to check fo
greater than 3...Any help would be great

Thanks
Mar

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

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with COUNTIF Cheryl MM[_2_] Excel Discussion (Misc queries) 4 January 2nd 08 04:15 PM
Problem w countif ingeman Excel Discussion (Misc queries) 2 July 17th 06 08:05 AM
COUNTIF problem with NOW() Spreadsheet Excel Worksheet Functions 21 June 26th 06 09:47 PM
Countif Problem John Moore Excel Discussion (Misc queries) 5 November 27th 05 07:09 PM
countif(and) problem Len Dolby Excel Programming 3 October 24th 03 01:48 PM


All times are GMT +1. The time now is 08:55 PM.

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

About Us

"It's about Microsoft Excel"