ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Event Code for Proper (https://www.excelbanter.com/excel-programming/390255-event-code-proper.html)

Steved

Event Code for Proper
 
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.

Gord Dibben

Event Code for Proper
 
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

On Mon, 28 May 2007 15:35:00 -0700, Steved
wrote:

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.



Steved

Event Code for Proper
 
Hello Gord

Thankyou.

"Gord Dibben" wrote:

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

On Mon, 28 May 2007 15:35:00 -0700, Steved
wrote:

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.





All times are GMT +1. The time now is 02:08 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com