View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
adidas VBA adidas VBA is offline
external usenet poster
 
Posts: 17
Default Formula to macro...anyone??

McGimpsey -
With this macro the desired result is not met. Please reference my
previous post with a table and a desired result columm.


Sub coffeeBreak()
Dim a1 As Boolean, a2 As Boolean, n As Long

For n = 2 To 35001
a1 = False
a2 = False

If 20030905 = Cells(n, 7).Value Then
If 20030905 = Cells(n, 8).Value Then
If Mid(Cells(n, 9).Value, 5, 1) = "Y" Then a1 = True
End If
End If

If (Cells(n, 1).Value = "DTW") Or _
(Cells(n, 1).Value = "MEM") Or _
(Cells(n, 1).Value = "MSP") Or _
(Cells(n, 3).Value = "DTW") Or _
(Cells(n, 3).Value = "MEM") Or _
(Cells(n, 3).Value = "MSP") _
Then
If Not (Cells(n, 5).Value = "CO") Then a2 = True
Else
If Not (Cells(n, 5).Value = "NW") Then a2 = True
End If

If (a1 And a2) Then
Cells(n, 11).Value = 1
Else
Cells(n, 11).Value = 0
End If
Next
End Sub



Thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!