View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
hotherps[_122_] hotherps[_122_] is offline
external usenet poster
 
Posts: 1
Default count cells if ""

Thanks Tom
I'm trying to use this within a Public Sub and I', thinking that you
can't because I'm getting nothing but errors from the Set Range.

I'll keep working at it.

Here is the full Sub (2 parts)

Dim need As Integer

Application.Calculation = xlManual

skillx = 9
timeStart = -1
timeStart2 = -1

For period = 1 To 12
timeStart = timeStart + 8
timeStart2 = timeStart2 + 8

For skilly = 104 To 124
skillNam = Sheet236.Cells(skillx, skilly).Value
need = (Sheet236.Cells(period + 318, skilly - 97).Value -
Sheet236.Cells(period + 304, skilly - 97).Value) * 4
If skillNam = "ENG" Then
Eng period, timeStart, skilly, need
ElseIf skillNam = "IND" Then
Ind period, timeStart, skilly, need
ElseIf skillNam = "MMS" Then
MMS period, timeStart2, skilly, need
Else
OtherSkill period, timeStart, skilly, skillNam, need
End If
Next skilly

Next period
end sub


Public Sub MMS(ByVal period As Integer, ByVal timeStart As Integer,
ByVal skilly As Integer, ByVal need As Integer)
With Sheet236
For x = 11 To 298
If .Cells(x, skilly).Value = "x" Then
For y = timeStart To timeStart + 7
If .Cells(x, y).Value = "." _
And Cells(x, y).Offset(0, 32).Value = "." _
And counter < 16 _
And need 0 Then
..Cells.Offset(x, y).Resize(1, 32).Value = "MMS"
need = need - 1
End If
Next y
End If
Next x
End With

Thanks for your help

End Sub


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