Experts Exchange connects you with the people and services you need so you can get back to work.
Improve company productivity with a Business Account.Sign Up
Public Function LookupCode(code As String) As String
Dim result() As String
Dim rng As Range
Dim c As Variant
result = Split(code, ",")
For Each c In result
Set rng = shPercentages.Range("A2:A15000").Find(c, LookIn:=xlValues)
If Not rng Is Nothing Then
LookupCode = FormatPercent(rng.Offset(ColumnOffset:=1).Value)
LookupCode = "Missing Data"
Open in new window
Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.
That said, how can I get the VBA code to work for all cells in column B? When I copy the =LookupCode(B22) to the other cells everything turns into this " #NAME? "
Ok, got the Macros fired up. It is having a problem with the objects that are missing the 5th character in the string, which is a possibility I need included.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.