J
John
First thanks for taking the time to help a poor soul out.
Here is my issue.
I have a list of vendor names. The vendor names are some what of an
abbreviation of the actual name. I want to write a function that will
take in the range of Vendor abbreviations and replace it with the
full
name. I thought a 'Select Case' would be easiest. I also would like to
return the name to the cell itself not another cell. The cell is not
turning red either. Here is my code :
Function ConvertVenName(Ven As Range) As String
Dim xlCalc As XlCalculation
Dim savScrnUD As Boolean
savScrnUD = Application.ScreenUpdating
Application.ScreenUpdating = True
xlCalc = Application.Calculation
Application.Calculation = xlCalculationManual
On Error GoTo CalcBack
Select Case Ven.Value
Case "3D ventures"
ConvertVenName = "3-D Ventures Ltd."
Case Else
Ven.Interior.Color = vbRed
End Select
Application.Calculation = xlCalc
Application.ScreenUpdating = savScrnUD
Exit Function
CalcBack:
MsgBox Err.Description
Application.Calculation = xlCalc
Application.ScreenUpdating = savScrnUD
End Function
cheers
John
Here is my issue.
I have a list of vendor names. The vendor names are some what of an
abbreviation of the actual name. I want to write a function that will
take in the range of Vendor abbreviations and replace it with the
full
name. I thought a 'Select Case' would be easiest. I also would like to
return the name to the cell itself not another cell. The cell is not
turning red either. Here is my code :
Function ConvertVenName(Ven As Range) As String
Dim xlCalc As XlCalculation
Dim savScrnUD As Boolean
savScrnUD = Application.ScreenUpdating
Application.ScreenUpdating = True
xlCalc = Application.Calculation
Application.Calculation = xlCalculationManual
On Error GoTo CalcBack
Select Case Ven.Value
Case "3D ventures"
ConvertVenName = "3-D Ventures Ltd."
Case Else
Ven.Interior.Color = vbRed
End Select
Application.Calculation = xlCalc
Application.ScreenUpdating = savScrnUD
Exit Function
CalcBack:
MsgBox Err.Description
Application.Calculation = xlCalc
Application.ScreenUpdating = savScrnUD
End Function
cheers
John