LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Function that replaces Text in cell

Hi All,

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. Here is my code (I
have commented out all unnecessary code):
Function ConvertVenName(Ven As Range) As String
Dim Cll As Range
Dim name 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
For Each Cll In Ven
Select Case Cell
Case "3D ventures"
name = "3-D Ventures Ltd."
' Case "Co-op Fuel"
' Cll = "Co-op Fuel"
' Case "Craig waterwell"
' Cll = "Craig Waterwell"
' Case "Denim"
' Cll = "Denim Pipeline"
' Case "Deno"
' Cll = "Deno Contracting Ltd."
' Case "DFI"
' Cll = "DFI"
' Case "DRW Roto"
' Cll = "D.R.W. Rotoslashing Ltd."
' Case "E&L Trucking"
' Cll = "E&L Trucking"
' Case "Echo"
' Cll = "Echo"
' Case "ESS"
' Cll = "ESS Support Services Worldwide"
' Case "Fabcor"
' Cll = "Fabcor"
' Case "Foley Inspection"
' Cll = "Foley Inspection Services Inc."
' Case "Foley Inspection "
Cll = "Foley Inspection Services Inc."
' Case Else
' Cll.Interior.Color = vbRed
End Select
ConvertVenName = name
Next Cll
CalcBack:
MsgBox Err.Description
'Application.Calculation = xlCalc
'Application.ScreenUpdating = savScrnUD
End Function

I keep getting a zero returned to the cell or a circular ref error.
This should be easy but I can't seem to see what I'm doing wrong.
Please help.

John

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
replaces formula to its value InspectorJim Excel Worksheet Functions 1 May 13th 09 02:41 AM
#Value replaces formula result when file is opened. But why? Arlen Excel Discussion (Misc queries) 8 July 18th 08 09:13 PM
Opening a second worksheet replaces the current doyle Excel Discussion (Misc queries) 1 February 12th 07 05:14 PM
How do you write an if statement that replaces #DIV/0! with 0 caliskier Excel Discussion (Misc queries) 6 March 10th 06 03:22 AM
Pasted text from Excel to Word replaces previous paragraph TT[_2_] Excel Programming 0 January 20th 05 06:07 PM


All times are GMT +1. The time now is 12:02 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"