Getting Run-Time Error '1004'
Unable to get the Vlookup property of the WorksheetFunction Class
I am not sure why. In Debug mode the variables are all correct.
Dim drg_code As String, disch_date As Date, facility As Variant, admit_type As String
Dim drg_value As Variant, look_up_sheet As Worksheet, ds As Worksheet, data_array As Variant, drg_descrip As Variant
Dim dyear As Variant, geo_zip As Variant, client_list As Worksheet, allowance As Variant, conc As Variant
Dim Arrays As Worksheet
Set look_up_sheet = ActiveWorkbook.Sheets("Sheet8")
facility = look_up_sheet.Range("C5")
Set client_list = ActiveWorkbook.Sheets("CLIENT LIST")
geo_zip = Application.WorksheetFunction.vlookup(facility, client_list.Range("A1:E16"), 2, False)
disch_date = Application.InputBox(prompt:="Enter the Discharge Date", Title:="Discharge Date", Type:=2)
If Year(disch_date) = 2009 Then
If disch_date <= 39993 Then
dyear = "010109"
Else
dyear = "063009"
End If
Else
dyear = Year(disch_date)
End If
admit_type = look_up_sheet.Range("F12")
drg_code = Application.InputBox(prompt:="Enter the DRG Code", Title:="DRG Code", Type:=1)
conc = dyear & admit_type & geo_zip
Set Arrays = ActiveWorkbook.Sheets("Arrays")
data_array = Application.WorksheetFunction.vlookup(conc, Arrays.Range("A1:E393"), 5, False)
Set ds = ActiveWorkbook.Sheets(dyear)
drg_value = Application.WorksheetFunction.vlookup(drg_code, ds.Range(data_array), 3, False)
UNABLE TO ATTACH FILE AS THEY'RE HUGE.
Bookmarks