This is a portion of a VisualFoxpro code that I try to translate in VBA, my problem is the Normalize() function (in RED). I read a lot on the internet about it but I'm still confuse on how it work. Does something exist in VBA to do the same thing.
'Retrieve the x and y data values
If LoadDataArrays("SHIP SPEED PPD", sngXValues, sngYValues) Then
'Call the function to normalize the independent variable value
If Normalize(txtOrderKnots.Text, sngNormalizedX, sngXValues) Then
'Call the function to calculate the value of the dependent parameter
If Look1D(sngNormalizedX, sngPPD, sngYValues) Then
'Determine which schedule to use
If (cboDriveMode.Text = "1 GT") And (cboDemand.Text = "Normal") Then
strSchedName = "PLA DEMAND FOR 1 GT DRIV"
ElseIf (cboDriveMode.Text = "2 GT") And (cboDemand.Text = "Normal") Then
strSchedName = "PLA DEMAND FOR 2 GT DRIV"
ElseIf (cboDriveMode.Text = "1 GT") And (cboDemand.Text = "Silent") Then
strSchedName = "SILENT DMD FOR 1 GT DRIV"
ElseIf (cboDriveMode.Text = "2 GT") And (cboDemand.Text = "Silent") Then
strSchedName = "SILENT DMD FOR 2 GT DRIV"
End If
If LoadDataArrays(strSchedName, sngXValues, sngYValues) Then
'Call the function to normalize the independent variable value
If Normalize(sngPPD, sngNormalizedX, sngXValues) Then
'Call the function to calculate the value of the dependent parameter
If Look1D(sngNormalizedX, sngPLA, sngYValues) Then
bPLAFound = True
End If
End If
End If
End If
End If
End If