Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 05-08-2016, 10:44 PM
macropod's Avatar
macropod macropod is online now propercase function Windows 7 64bit propercase function Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,342
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In that case, try:
Code:
Sub Reformat()
Dim i As Long, StrTmp As String
With Selection
  For i = 1 To .Words.Count
    If .Words(i) = LCase(.Words(i)) Then
      StrTmp = StrTmp & .Words(i)
    Else
      StrTmp = StrTmp & UCase(Left(.Words(i), 1)) & LCase(Mid(.Words(i), 2, Len(.Words(i)) - 1))
    End If
  Next
  .Text = StrTmp
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
propercase function Restrict Editing function disable insert textbox function IanM_01 Word 5 11-21-2015 02:29 AM
IF Function Azleenda Excel 2 11-10-2015 10:06 PM
propercase function #REF! Error in calling VBA function disappears when function is copied lcaretto Excel Programming 2 05-26-2014 07:19 PM
Creating a graph for Future Value function (FV function) bmoody Excel 2 11-06-2013 10:52 AM
if function help jim831 Excel 2 10-29-2010 07:06 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 04:13 AM.


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