patrussell
Technical User
I have the following code that needs to compare two values to determine what value to save. I had everything working until I added the IF...THEN checks on whether value b is larger than a. When I try to compile I get the "Else without If" error at the second check (b1002).
I know this is probably something simple that I'm missing but I just can't see it. Any help is greatly appreciated.
I realize this is not the most efficient code...I plan to clean it up after I make sure it works in it's current structure.
Pat Russell
I know this is probably something simple that I'm missing but I just can't see it. Any help is greatly appreciated.
I realize this is not the most efficient code...I plan to clean it up after I make sure it works in it's current structure.
Code:
Set fs = CreateObject("Scripting.FileSystemObject")
If fs.FileExists("D:\Uploads\lville.eq.runtime") Then
If b1001 > a1001 Then e1001 = a1001
Else
e1001 = Format(a1001 - b1001, "0000")
End If
If b1002 > a1002 Then e1002 = a1002
Else
e1002 = Format(a1002 - b1002, "0000")
End If
If b1003 > a1003 Then e1003 = a1003
Else
e1003 = Format(a1003 - b1003, "0000")
End If
If b1004 > a1004 Then e1004 = a1004
Else
e1004 = Format(a1004 - b1004, "0000")
End If
If b1005 > a1005 Then e1005 = a1005
Else
e1005 = Format(a1005 - b1005, "0000")
End If
If b1006 > a1006 Then e1006 = a1006
Else
e1006 = Format(a1006 - b1006, "0000")
End If
If b1007 > a1007 Then e1007 = a1007
Else
e1007 = Format(a1007 - b1007, "0000")
End If
If b1008 > a1008 Then e1008 = a1008
Else
e1008 = Format(a1008 - b1008, "0000")
End If
Else
e1001 = a1001
e1002 = a1002
e1003 = a1003
e1004 = a1004
e1005 = a1005
e1006 = a1006
e1007 = a1007
e1008 = a1008
End If
Pat Russell