Event Code for Proper

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello from Steve Dee

I have in Cell J2 the Value SWANSON DEPOT

If I put in another cell =PROPER(J2) it will change it to Swanson Depot.

My question please is it possible to do an event Code please.

Thankyou.
 
Steve

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column > 2 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = Application.Proper(Target.Formula)
ErrHandler:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP
 
Hello Gord

Thankyou.

Gord Dibben said:
Steve

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column > 2 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = Application.Proper(Target.Formula)
ErrHandler:
Application.EnableEvents = True
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top