How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask John D Your Own Question
John D
John D, Bachelor's Degree
Category: Microsoft Office
Satisfied Customers: 9666
Experience:  Bachelor of Science - Engineering Consultant
53785
Type Your Microsoft Office Question Here...
John D is online now
A new question is answered every 9 seconds

Getting error 1004 Unable to get the VLookup property of the

This answer was rated:

Getting error 1004 Unable to get the VLookup property of the WorksheetFunction class on macro that has worked for a long time. Recently came to this firm and there's no documentation as to the macros. Staff enter data for txtCap, txtRecall, txtClosed and then the lookup is supposed to enter additional information from another sheet but error appears when they click to add the data to the sheet.

Private Sub cmdAdd_Click()
Dim RowCount As Long
Dim ctl As Control

' Check input
If Me.txtCLOSED.Value = "" Then
MsgBox "Please scan/enter the Matter number barcode.", vbExclamation, "Closed Files"
Me.txtCLOSED.SetFocus
Exit Sub
End If

' Add data to worksheet
RowCount = Worksheets("ClosedFiles").Range("A1").CurrentRegion.Rows.Count
With Worksheets("ClosedFiles").Range("A1")
.Offset(RowCount, 0).Value = Me.txtSTORAGEDATE.Value
.Offset(RowCount, 1).Value = Me.txtCAP.Value
.Offset(RowCount, 2).Value = Me.txtRECALL.Value
.Offset(RowCount, 3).Value = Me.txtCLOSED.Value

.Offset(RowCount, 4).Value = Application.WorksheetFunction.VLookup(txtCLOSED.Value, Range("EliteData"), 83, False)
.Offset(RowCount, 5).Value = Application.WorksheetFunction.VLookup(txtCLOSED.Value, Range("EliteData"), 2, False)
.Offset(RowCount, 6).Value = Me.txtDATECLOSED.Value
.Offset(RowCount, 8).Value = Application.WorksheetFunction.VLookup(txtCLOSED.Value, Range("EliteData"), 15, False)
If checkDND = True Then _
.Offset(RowCount, 7).Value = "Wills-DND"
End With

' Clear form
For Each ctl In Me.Controls
If TypeName(ctl) = "TextBox" Or TypeName(ctl) = "ComboBox" Then
ctl.Value = ""
' ElseIf TypeName(ctl) = "CheckBox" Then
' ctl.Value = True

End If
Next ctl
Me.txtRECALL.SetFocus

End Sub

NewITZone :

Hi, Welcome to JustAnswer. This is Mahbub Shahin can assist you.
Please let me know when you will be ready?

Customer:

ready now

NewITZone :

Please run the file

NewITZone :

You can ignore the error with On Error Resume Next.

Customer:

sorry, what file?

NewITZone :

I mean the spreadsheet

Customer:

Okay I did - got the same error. Didn't get On Error Resume Next.

NewITZone :

Could you please send me the file

Customer:

Did you get it?

NewITZone :

no.

NewITZone :

Please upload here

Customer:

I tried using the paperclip to attach but clicking OK doesn't attach

NewITZone :

www.wikisend.com

NewITZone :

Click on the link then upload the file and send me the link

NewITZone :

Now I am out side my home.

NewITZone :

The speed is not too fast

Customer:

It appears English is not your first language - do you mean you are not able to work on my issue at the moment because it is slow to upload the file?

NewITZone :

No sir.

NewITZone :

Actually my download speed is slow currently.

NewITZone :

I am apologize. I opt out and leave this question for other experts.

NewITZone :

Please do not rate me.

NewITZone :

Please rate the person who solve your problem.

NewITZone :

Thank you.

Hi, I will try to help you with this question. Please let me know when you're back online so we can start the session
Customer: replied 4 years ago.


I'm here!


 

Ok I checked that part of the code and it looks ok.

Could you start the macro and type 137283 in the "CLOSED File barcode" field then click the Add Closed file button

Let me know what happens
Customer: replied 4 years ago.


That worked fine.

There you go. Apparently you have been entering in that field codes that do not exist


If you have any further questions do not hesitate to ask, and please don't forget to rate my solution "Excellent" or "Good" if I was able to help

Thanks
Customer: replied 4 years ago.


Have discussed with assistant who actually uses this and NOW she says she's been ignoring an error when the file first opens


 


Sub GetFreshData()


Worksheets("Data").Visible = xlSheetVisible


Worksheets("Data").Activate


ActiveWorkbook.RefreshAll


Worksheets("Data").Visible = xlSheetInvisible


End Sub


 


It stalls at xlSheetInvisible - and error is Can't find project or library

Ok that is really a different question. Please go ahead and rate my answer which has addressed the VLOOKUP error that you have initially asked so I can get credit for my time.

Thanks

 

 

*** RATING REQUIRED ***

John D, Bachelor's Degree
Category: Microsoft Office
Satisfied Customers: 9666
Experience: Bachelor of Science - Engineering Consultant
John D and 2 other Microsoft Office Specialists are ready to help you

Thanks

 

In the above code try replacing

xlSheeVisible with TRUE

and

xlSheetInvisible with FALSE

 

 

Customer: replied 4 years ago.


Already did that - doesn't work.


Fixed it myself.

Glad you got that error fixed.

Related Microsoft Office Questions