View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
GKeramidas GKeramidas is offline
external usenet poster
 
Posts: 38
Default Nested IF statements - simplify?

untested:

Sub test()
If theRunner < Empty And theRunner < "runner" And theRunner < "scr" Then
Range("H1").Select
Do Until Trim(LCase(ActiveCell)) = theRunner
ActiveCell.Offset(1, 0).Select
Loop
wOutSht.Cells(runnerOSet, "AJ").Value = ActiveCell.Offset(0, -7).Value
End If
End Sub

--


Gary


"Mark K." wrote in message
...
Hi,

Just looking for a way to cut down on some nested if statements. Currently
have the following:

If theRunner < Empty Then
If theRunner < "runner" Then
If theRunner < "scr" Then
Range("H1").Select
Do Until Trim(LCase(ActiveCell)) = theRunner
ActiveCell.Offset(1, 0).Select
Loop
wOutSht.Cells(runnerOSet, "AJ").Value = ActiveCell.Offset(0, -7).Value
End If
End If
End If

Is there a way to get the first 3 lines into 1? Basically want it to
ignore empty cells and those containing the strings "runner" or "scr".

TIA