VBA Function

ziad alsayed

Well-known Member
Joined
Jul 17, 2010
Messages
665
dear all

i am using the below function and it is working, but if i use in a cell that is formatted is percentage (60%, 80%....) it will not work.

appreciate any assistance


Code:
Function GetRemarks(rng As Range) As String
Dim Appraisal As Byte
Appraisal = rng.Value
Select Case Appraisal
    Case 60 To 79
    GetRemarks = "Meet Expectation"
    Case Is > 80
    GetRemarks = "Above Expectation"
    Case Is < 60
    GetRemarks = "Below Expectation"
End Select
End Function
 
..don't need a vba function at all
=LOOKUP(E16, {0,0.6,0.8},{"Below","Meet","Above"}) & " Expectation"
now where's my coat?.. :grin::outtahere:
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)

Forum statistics

Threads
1,224,521
Messages
6,179,286
Members
452,902
Latest member
Knuddeluff

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top