#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11
Default Cond Format & Proper

Trying to use the Proper Function in Cond Format so when people type names it
automatically corrects it to Title case.Please advice how i can acheive this.

Many thanks

laurie g
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Cond Format & Proper

Conditional formatting doesn't affect cell content in any way. One way is to
use another column:

=PROPER(A1)

or another is a change event for column A:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Target.Value = WorksheetFunction.Proper(Target.Value)
End If
End Sub

Regards,
Stefi



laurie g ezt *rta:

Trying to use the Proper Function in Cond Format so when people type names it
automatically corrects it to Title case.Please advice how i can acheive this.

Many thanks

laurie g

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Cond Format & Proper

Just a warning.

This will convert any formula in column A to a value, too.

Maybe:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
application.enableevents = false
Target.Formula = WorksheetFunction.Proper(Target.Formula)
application.enableevents = true
End If
End Sub

The "application.enableevents = false" stops the code from firing the event.

Stefi wrote:

Conditional formatting doesn't affect cell content in any way. One way is to
use another column:

=PROPER(A1)

or another is a change event for column A:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Target.Value = WorksheetFunction.Proper(Target.Value)
End If
End Sub

Regards,
Stefi

laurie g ezt *rta:

Trying to use the Proper Function in Cond Format so when people type names it
automatically corrects it to Title case.Please advice how i can acheive this.

Many thanks

laurie g


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Cond Format & Proper

Hi Dave,

Thanks for the warning, it is generally true, in Laurie's case I supposed
that if column A is used for typing in names (that is Target contains a value
just typed in), there will be no formulae in the range affected by the
function!

Regards,
Stefi


Dave Peterson ezt *rta:

Just a warning.

This will convert any formula in column A to a value, too.

Maybe:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
application.enableevents = false
Target.Formula = WorksheetFunction.Proper(Target.Formula)
application.enableevents = true
End If
End Sub

The "application.enableevents = false" stops the code from firing the event.

Stefi wrote:

Conditional formatting doesn't affect cell content in any way. One way is to
use another column:

=PROPER(A1)

or another is a change event for column A:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Target.Value = WorksheetFunction.Proper(Target.Value)
End If
End Sub

Regards,
Stefi

âžlaurie g❠ezt Ã*rta:

Trying to use the Proper Function in Cond Format so when people type names it
automatically corrects it to Title case.Please advice how i can acheive this.

Many thanks

laurie g


--

Dave Peterson

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default Cond Format & Proper

Hi Dave,

application.enableevents = false

is of course necessary, I forgot it!

Thanks,
Stefi

Stefi ezt *rta:

Hi Dave,

Thanks for the warning, it is generally true, in Laurie's case I supposed
that if column A is used for typing in names (that is Target contains a value
just typed in), there will be no formulae in the range affected by the
function!

Regards,
Stefi


Dave Peterson ezt *rta:

Just a warning.

This will convert any formula in column A to a value, too.

Maybe:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
application.enableevents = false
Target.Formula = WorksheetFunction.Proper(Target.Formula)
application.enableevents = true
End If
End Sub

The "application.enableevents = false" stops the code from firing the event.

Stefi wrote:

Conditional formatting doesn't affect cell content in any way. One way is to
use another column:

=PROPER(A1)

or another is a change event for column A:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 1 Then
Target.Value = WorksheetFunction.Proper(Target.Value)
End If
End Sub

Regards,
Stefi

âžlaurie g❠ezt Ã*rta:

Trying to use the Proper Function in Cond Format so when people type names it
automatically corrects it to Title case.Please advice how i can acheive this.

Many thanks

laurie g


--

Dave Peterson

Reply
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
Custom Format Cell nastech Excel Discussion (Misc queries) 13 April 28th 06 08:31 PM
Convert data into proper time format [email protected] Excel Worksheet Functions 1 April 25th 06 07:39 PM
cond format jim brown Excel Worksheet Functions 2 April 20th 06 01:20 PM
Cond Format & helper-cell based "duplicate rec" tricked by content Dennis Excel Discussion (Misc queries) 3 December 16th 05 06:55 PM
auto date: cond. format Question nastech Excel Discussion (Misc queries) 0 December 13th 05 06:26 PM


All times are GMT +1. The time now is 04:40 AM.

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

About Us

"It's about Microsoft Excel"