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

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".

46 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

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

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated November 23, 2020 Views 13,360 Applies to: