UCase problem

I have the following Sub that works on some computers but not on others. I get a Compile error "Can't find project or library" and hi lites UCase

Private Sub Worksheet_Change(ByVal Target As Range)

Application.EnableEvents = False

If Not Intersect(Target, Range("F9,C70,C71,B127,B130,C178,ID606")) Is Nothing Then

Target.Value = UCase(Target.Value)

End If

Application.EnableEvents = True

End Sub

 

Question Info


Last updated July 11, 2019 Views 12,531 Applies to:
Answer
Answer

If other VB functions work, but that one doesn't (which I am assuming is the case), it usually means there is something out there somewhere (variable, subroutine name, etc.) with that same name. While it would be best to track that down and change it so it avoids the conflict, you should be able to circumvent the problem by changing that line of code to this...

Target.Value = VBA.UCase(Target.Value)


NOTE: Please mark the message or messages (yes, you can mark more than one) that answer your question as the "Answer" so that others will know your question has been resolved.
*** PLEASE READ ***

If this response answers your question, please mark it as the "Answer".

43 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.