View Single Post
 
Old 10-30-2015, 01:10 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I'd have thought it pretty obvious you could use:
Code:
Sub MetIndividualGoals()
Dim i As Long
With ActiveSheet
  For i = 5 To 7
    If .Range("E" & i).Value >= .Range("F" & i).Value Then
      .Range("H" & i).Value = "Yes"
    Else
      .Range("H" & i).Value = "No"
    End If
  Next
  For i = 14 To 16
    If .Range("E" & i).Value >= .Range("F" & i).Value Then
      .Range("H" & i).Value = "Yes"
    Else
      .Range("H" & i).Value = "No"
    End If
  Next
End With
End Sub
Slightly less obvious is:
Code:
Sub MetIndividualGoals()
Dim i As Long
With ActiveSheet
  For i = 5 To 16
    If (i < 8) Or (i > 13) Then
      If .Range("E" & i).Value >= .Range("F" & i).Value Then
        .Range("H" & i).Value = "Yes"
      Else
        .Range("H" & i).Value = "No"
      End If
    End If
  Next
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote