• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Run-time error 457

HanSam

Member
Hi,

Can you help me debug the attached file? This has been working for me since the beginning of the year and then this happened.

upload_2017-6-23_10-6-32.png

I can't seem to get it run correctly, as I have not touched the code since it has been working great already.
 

Attachments

  • CCDB Entry Form1.xlsm
    126.1 KB · Views: 3
I changed in your code (for the userform) deleting out the vbModeless command. In the Properties window for the userform, I changed SHOW to vbModeless. Doing that kept the workbook from erroring out on the macro to show the form.

Now, having the form display ok (actually not having an error there causing the workbook to freeze), I stepped through your Routine Module (CCDB) code line by line, using F8.

The error you are seeing is generated from this portion of the Module:

Code:
Sub listPrjCell()
Dim i As Long
Set prjDict = CreateObject("Scripting.Dictionary")

For i = 5 To Sheets("DataEntry").Cells(Rows.Count, 1).End(xlUp).Row
     prjDict.Add Item:=Sheets("DataEntry").Cells(i, 1), Key:=Sheets("DataEntry").Cells(i, 1).Value
Next

End Sub

What it seems to be doing is going row by row and erroring out near the bottom of your sheet DATA ENTRY. There is something in one of the last rows ? that seems to be causing the error.

Does your code allow for duplicates in that sheet ? Would a duplicate entry cause the error ?
 
Thanks for the response.

Does your code allow for duplicates in that sheet ? Would a duplicate entry cause the error ?

Having said that, I actually went and checked for duplicates and found a pair. Deleted them and it worked perfectly again!!!

I guess I have to write something up for duplicates. Thank you!
 
Back
Top