-
Runtime error 1004
Hi I am trying to target the current selection in a list box in order to run a VLOOKUP to return offset colum results to text boxes on the same user form.
Using the following code I get runtime error 1004.
[VBA]Private Sub Category_click()
Dim Task As String
If pref_addr_1.Value <> 0 Then
Task = Category.Value
Call tasksearch(Task)
End If
End Sub
Sub tasksearch(Task)
Dim DEFtask
Dim DEF
Dim myrange
Set myrange = Worksheets("full_list").Range("B2:N145")
DEFtask = Application.WorksheetFunction.VLookup(Task, myrange, 1, False)
DEF = DEF + DEFtask
Worksheets("Full_list").Range("B3") = DEF
[/VBA]
I then tried to initialise the class using
[VBA]
Application.WorksheetFunction.VLookup.Activate
[/VBA]
It then reports the error "argument non optional"
can anyone suggest a reason for it, or a solution please?
regards
Dave
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules