Hi Myles,
thank you very much for answering to my post.
I tried your solution and it worked for me partially. Now I'm getting
information populated in my "Happy" worksheet, but I'm also getting
information populated for my "Sad" worksheet.
Perhaps I didn't explain my situation in enough detailed.
I have a do loop inside a do loop. Say, List of A to Z records
Inside each record, I need to extract field inforamation and populate them
into the "happy" or "Sad" spreadsheet. I don't know where I should put my
"SAD" function so that it only runs either "Happy" or "SAD". Now, I'm
getting results on both spreadsheets
bError = False
x = 15
intNumberOfTrades = 7
i = 8
Do Until bError = True
If sValue = " " Then
Exit Do
End If
'---------------------------------------------------------------------
' Check if Further Benneficiary exists (row 56A on Audsum
Mnemonic)
' if true, call HAPPY
'---------------------------------------------------------------------
c = 9
Do While (sValue <> "56A" Or c < 25)
sValue = Trim$(sValue)
If sValue = "56A" Then
Call HAPPY
Exit Do
Else
c = c + 1
End If
Loop
Call SAD
i = i + 1
intNumberOfTrades = intNumberOfTrades + 1
If x < 37 Then
x = x + 2
ElseIf x >= 37 Then
'go to next screen
x = 15
End If
rc = MB_CopyPSToString(gPSid, 40, 2, 5, sMessage) '
If sMessage = "I9001" Or sMessage = "E8001" Then
bError = True
End If
Loop