I have used code similar to below but for some reason its not working this time. I compared the code, nothing is different. The dim are all the same.
HOwever, while the "dataFound" is getting a range the "allowance" and "iDescrip" are coming up as empty.
Dim dataSheet As String, iDRG As Variant, iDescrip As Variant
Dim allowance As Variant, dataFound As Range
Dim dataRange As Range, billedCharges As String, adjustedCharges As String
Dim rev278 As String, notOulier As Boolean, outlierPercent As String
Dim outlierCharge As Double, outlierPayment As Double
Set inp_form = ActiveWorkbook.Sheets("INPATIENT")
iDRG = inp_form.Range("C12").Value
billedCharges = inp_form.Range("C7").Value
rev278 = inp_form.Range("C18").Value
adjustedCharges = billedCharges - rev278
dataSheet = "MS-DRG"
Set dataRange = ActiveWorkbook.Sheets(dataSheet).Range("A1:C" & ActiveWorkbook.Sheets(dataSheet).Cells(Rows.Count, "A").End(xlUp).Row + 1)
Set dataFound = dataRange.Find(iDRG, , , , xlWhole)
If dataFound Is Nothing Then
allowance = adjustedCharges * 0.6223
iDescrip = "MS-DRG NOT FOUND IN GEORGIA FEE SCHEDULE."
inp_form.Range("B14").Value = iDescrip
inp_form.Range("F14").Value = allowance
notOutlier = True
Else
allowance = dataFound.Offset(, 2).Value
iDescrip = dataFound.Offset(, 1).Value
inp_form.Range("B14").Value = iDescrip
inp_form.Range("F14").Value = allowance
End If
Bookmarks