I have a program which is supposed to read a textfile and check it's contents.
Sheet1, is where I upload and read the textfile.
In Sheet2, I named it "Library" where I store all my Beneficiary name and numbers. Library sheet only has 2 columns which are Column A that contains the "BeneficiaryName", while ColumnB contains "BeneficiaryNumber"
As you can see, BeneficiaryNumber acts as an IDnumber to my BeneficiaryName.
So after reading the uploaded textfile, I need to check the value of the "BeneficiaryNumber" contained in the textfile and compare its value to my existing library found in Sheet2.
Now if the BeneficiaryNumber in my textfile exists in my Library Sheet, all is good, nothing much to do but to print it in Sheet1, however, if the BeneficiaryNumber is not found in my Library, I need to have a pop-up or messageBox that will say "Error, no BeneficiaryNumber xxxxxx does not exist in Library"
However I am having an endless loop at this part of the program:
Code:
I'm sorry I'm not very good at debugging ;(
I'm not sure if my problem lies with my Column Range or maybe somewhere else. I've been trying to debug this for the past 4hours but I still can't get past this last problem. I'm sorry any help is really appreciated Thank you
Sheet1, is where I upload and read the textfile.
In Sheet2, I named it "Library" where I store all my Beneficiary name and numbers. Library sheet only has 2 columns which are Column A that contains the "BeneficiaryName", while ColumnB contains "BeneficiaryNumber"
As you can see, BeneficiaryNumber acts as an IDnumber to my BeneficiaryName.
So after reading the uploaded textfile, I need to check the value of the "BeneficiaryNumber" contained in the textfile and compare its value to my existing library found in Sheet2.
Now if the BeneficiaryNumber in my textfile exists in my Library Sheet, all is good, nothing much to do but to print it in Sheet1, however, if the BeneficiaryNumber is not found in my Library, I need to have a pop-up or messageBox that will say "Error, no BeneficiaryNumber xxxxxx does not exist in Library"
However I am having an endless loop at this part of the program:
Code:
Code:
y=2
Do While Not EOF(1)
Line Input #1, Data
strtemp = Data
If GetField(strtemp,1,",")="PMT" Then
strbenenumber = GetField(strtemp,6,",")
Sheets("Library").Select
Do While strbenenumber <> Sheets("Library").Range("A" & y).Value
If strbenenumber = Sheets("Library").Range("B" & y).Value Then
strbeneName = Sheets("Library").Range("A" & y).Value
Exit Do
End If
y=y+1
Loop
Sheets("Sheet1").Select
Cells(5,3)
If strbenenumber <> Sheets("Library").Range("B" & y).Value Then
MsgBox ("Error! BeneficiaryNumber"&strbenenumber "does not exist!")
End If
I'm not sure if my problem lies with my Column Range or maybe somewhere else. I've been trying to debug this for the past 4hours but I still can't get past this last problem. I'm sorry any help is really appreciated Thank you