Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 12
Default Doesn't Add Up

Hi,
the third 'If' statement is supposed to count all of the dates in the
7th column & not the blank cells. Any idea why it won't work (returns a
result of '0') Like I said before, novice!
Cheers.

Dim i As Integer, c As Integer, d As Integer, e As Integer
d = 0
c = 0
e = 0

For i = 27 To 321



If Cells(i, 6).Value < Now Then
d = d + 1


If Cells(i, 6).Value < Now And Cells(i, 7).Value = "" Then
c = c + 1

If Cells(i, 7).Value < "" Then
e = e + 1

End If
End If
End If

Next i


  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 1,726
Default Doesn't Add Up

It will never get there

Dim i As Integer, c As Integer, d As Integer, e As Integer
d = 0
c = 0
e = 0

For i = 27 To 321



If Cells(i, 6).Value < Now Then

If Cells(i, 7).Value = "" Then
c = c + 1
Else
d = d + 1
End If

ElseIf Cells(i, 7).Value < "" Then
e = e + 1
End If
Next i


"egibberate" wrote in message
...
Hi,
the third 'If' statement is supposed to count all of the dates in
the 7th column & not the blank cells. Any idea why it won't work (returns
a result of '0') Like I said before, novice!
Cheers.

Dim i As Integer, c As Integer, d As Integer, e As Integer
d = 0
c = 0
e = 0

For i = 27 To 321



If Cells(i, 6).Value < Now Then
d = d + 1


If Cells(i, 6).Value < Now And Cells(i, 7).Value = "" Then
c = c + 1

If Cells(i, 7).Value < "" Then
e = e + 1

End If
End If
End If

Next i




  #3   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 12
Default Doesn't Add Up

Sorry Bob,
I should have included the last part so you know what I'm
doing.

MsgBox Str(d) & Chr(32) & "Target Code Dates" & Chr(13) & Str(c) & Chr _
(32) & "Target Deficit" & Chr(13) & Str(e) & Chr(32) & "Machines shipped so
far"

Column 6 & 7 are both date columns. Column 6 is the 'Target Shipping' date &
column 7 the 'Actual Shipping date'. From the information I input I can have
a Msgbox telling me three things (if I could get the last part to work)
ie. How many 'Target Shipping' dates there have been this month, how many
'Shipping Dates' we missed & how many we 'Shipped so far'.

Thanks very much for your reply.




"Bob Phillips" wrote in message
...
It will never get there

Dim i As Integer, c As Integer, d As Integer, e As Integer
d = 0
c = 0
e = 0

For i = 27 To 321



If Cells(i, 6).Value < Now Then

If Cells(i, 7).Value = "" Then
c = c + 1
Else
d = d + 1
End If

ElseIf Cells(i, 7).Value < "" Then
e = e + 1
End If
Next i


"egibberate" wrote in message
...
Hi,
the third 'If' statement is supposed to count all of the dates in
the 7th column & not the blank cells. Any idea why it won't work (returns
a result of '0') Like I said before, novice!
Cheers.

Dim i As Integer, c As Integer, d As Integer, e As Integer
d = 0
c = 0
e = 0

For i = 27 To 321



If Cells(i, 6).Value < Now Then
d = d + 1


If Cells(i, 6).Value < Now And Cells(i, 7).Value = ""
Then
c = c + 1

If Cells(i, 7).Value < "" Then
e = e + 1

End If
End If
End If

Next i






Reply
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



All times are GMT +1. The time now is 04:38 PM.

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

About Us

"It's about Microsoft Excel"