Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-03-2018, 05:42 PM
Chayes Chayes is offline Making exceptions to PROPER Windows XP Making exceptions to PROPER Office 2003
Advanced Beginner
Making exceptions to PROPER
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default Making exceptions to PROPER

Hi All


I use this code to force Proper case in columns F:H




Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Cells.Count > 1 Or Target.HasFormula Then Exit Sub

On Error Resume Next

If Not Intersect(Target, Range("F:H")) Is Nothing Then

Application.EnableEvents = False

Target = StrConv(Target, vbProperCase)

Application.EnableEvents = True

End If

On Error GoTo 0



End Sub




This works fine , but sometimes fails in certain circumstances , particularly after symbols. For example , after brackets. The code in this case forces (Content) to (content).


Can someone help with an amendment to the code so that letters following symbols are left as capitals?


Grateful for any advice.






Very Best Wishes ,
Reply With Quote
  #2  
Old 06-03-2018, 11:41 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Making exceptions to PROPER Windows 7 64bit Making exceptions to PROPER Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,771
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Hi
as you have already 50+ posts you should know
1. It is important to post in the correct forum, be it for you or the other members
2. Code should be wrapped with code tags.
I will move the post
Please add tags - Thanks
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #3  
Old 06-04-2018, 02:52 AM
p45cal's Avatar
p45cal p45cal is offline Making exceptions to PROPER Windows 10 Making exceptions to PROPER Office 2016
Expert
 
Join Date: Apr 2014
Posts: 867
p45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond reputep45cal has a reputation beyond repute
Default

Try:
Code:
Target = Application.Proper(Target)
Reply With Quote
  #4  
Old 06-04-2018, 06:20 AM
Chayes Chayes is offline Making exceptions to PROPER Windows XP Making exceptions to PROPER Office 2003
Advanced Beginner
Making exceptions to PROPER
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default

HI


Ok Yes , that's fixed it - thanks!




Very Best Wishes ,
Reply With Quote
  #5  
Old 06-04-2018, 06:22 AM
Chayes Chayes is offline Making exceptions to PROPER Windows XP Making exceptions to PROPER Office 2003
Advanced Beginner
Making exceptions to PROPER
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default

Sorry for putting this in the wrong place. I will try to use the correct quotes in future.
Reply With Quote
  #6  
Old 06-04-2018, 09:00 AM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Making exceptions to PROPER Windows 7 64bit Making exceptions to PROPER Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,771
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

And please add code tags.....
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #7  
Old 06-04-2018, 09:18 AM
Chayes Chayes is offline Making exceptions to PROPER Windows XP Making exceptions to PROPER Office 2003
Advanced Beginner
Making exceptions to PROPER
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default

Yes , I'll try to do that in the future. I wouldn't know how to do it on a 'solved' post. The site assumes a lot of knowledge which a user may not necessarily have.
Reply With Quote
  #8  
Old 06-04-2018, 11:36 PM
Pecoflyer's Avatar
Pecoflyer Pecoflyer is offline Making exceptions to PROPER Windows 7 64bit Making exceptions to PROPER Office 2010 64bit
Expert
 
Join Date: Nov 2011
Location: Brussels Belgium
Posts: 2,771
Pecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant futurePecoflyer has a brilliant future
Default

Just edit the relevant post - click "Go advanced" - select your code and click the #button
__________________
Did you know you can thank someone who helped you? Click on the tiny scale in the right upper hand corner of your helper's post
Reply With Quote
  #9  
Old 06-05-2018, 07:19 AM
Chayes Chayes is offline Making exceptions to PROPER Windows XP Making exceptions to PROPER Office 2003
Advanced Beginner
Making exceptions to PROPER
 
Join Date: May 2012
Posts: 79
Chayes is on a distinguished road
Default

Ok I'll be sure to do that in the future. Thank you for your advice.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Making exceptions to PROPER Need help w/ IF function that has multiple exceptions! batota06 Excel 2 06-11-2018 01:53 AM
Exceptions on my documents Martinod Word 1 03-12-2018 11:53 AM
Word Autocorrect exceptions not working. Spotofpaint Word 0 10-23-2014 06:14 PM
Autocorrect Exceptions not working danvdr Word 6 05-26-2014 09:37 PM
Exceptions for 'Capitalize first letter of sentences' gazpacho Word 1 01-12-2012 11:43 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 05:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft