Posting a Value in Cell Causing Infinite Loop From Preexisting Code

AggieIE

New Member
Joined
Jul 29, 2014
Messages
1
Hi I'm working on some code in VBA in Excel 2010 and I'm running into a problem with preexisting code in the spreadsheet. My code reads in data from another workbook and posts the value in a certain cell, which works fine. However, there is code that is already there which causes an infinite loop, and I have no idea how to fix it. My code runs fine and whenever I stop the code the value will paste, but otherwise it just gets stuck between these two functions from the preexisting code.
The preexisting code populates the cells and looks like this:



Function WORD(PHRASE, TIME, FOLLOWING)
If FOLLOWING = 0 Then
WORD = 0
ElseIf TIME = FOLLOWING Then
WORD = 0
ElseIf PHRASE Like "5 Min C/O" Then
WORD = 0
ElseIf PHRASE = "10 Min C/O" Then
WORD = 0
ElseIf PHRASE Like "15 Min C/O*" Then
WORD = 0
ElseIf PHRASE Like "20 Min C/O" Then
WORD = 0
ElseIf PHRASE Like "30 Min C/O" Then
WORD = 0
ElseIf PHRASE Like "Continued" Then
WORD = 0
ElseIf PHRASE Like "End" Then
WORD = 0
Else: WORD = TIME

End If
End Function

Function DELETE(PRESENT, PAST)
If PRESENT = PAST Then
DELETE = 0
Else: DELETE = PRESENT

End If



ALSO: Along with this code is this written into the spreadsheet

=IF((ISERROR(VLOOKUP($D6,'\\BBUROCKFSXXPP01\Public\Production\####Orders\[Mixer Exceptions.xlsx]Sheet 1'!$A$4:$S$45,2,TRUE)=TRUE))," ",VLOOKUP($D6,'\\BBUROCKFSXXPP01\Public\Production\####Orders\[Mixer Exceptions.xlsx]Sheet 1'!$A$4:$S$45,2))
 

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top