LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 87
Default Always Change Input Text to Proper

Thanks Harald, works perfectly


"Harald Staff" wrote in message
...
Hi

Proper is a worksheet function, not a VBA function.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range("O7:O24")) Is Nothing Then
Application.EnableEvents = False
.Formula = StrConv(.Formula, vbProperCase)
Application.EnableEvents = True
End If
End If
End With
End Sub

(I've changed .value to .formula to allow formula entries in the cells.
Change back if it's unwanted.)

HTH. Best wishes Harald


"John" skrev i melding
...
I am trying to write some code that will always change Text once entered

to
the proper case. The text in question is First Name, Last Name (entered

in
cells O7:O24). I am using the following but am getting an error. What am

I
doing wrong?

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Count = 1 Then
If Not Intersect(.Cells, Range("O7:O24")) Is Nothing Then
Application.EnableEvents = False
.Value = Proper(.Value)
Application.EnableEvents = True
End If
End If
End With
End Sub


Thanks









 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot change text to proper case using formula LaDena Excel Worksheet Functions 2 December 18th 07 05:33 PM
trying to change Proper function results to text? Arlene Excel Worksheet Functions 1 August 23rd 06 09:45 PM
How do I change text to proper when text is already in upper? K New Users to Excel 2 February 8th 06 10:32 AM
How can I change text to proper text in multiple cells. bethye99 Excel Discussion (Misc queries) 1 January 10th 06 06:17 PM
How do I change all cells to Proper text in Excel Bruce Excel Worksheet Functions 1 October 4th 05 05:11 PM


All times are GMT +1. The time now is 10:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"