Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2006

Tip: Looking for answers? Try searching our database.

Convert any case format  to Upper Case format

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Harish - 04 Sep 2006 20:10 GMT
Hi All

I have prepared the code for the worksheet as follows. This code converts
the text to upper case format from any cell of the worksheet. Also it checks
for the specific text as well. This code works fine for all columns and rows
in the worksheet.
But I want to apply this code to column B only instead of whole worksheet.
Means whatever I will type in Column B should be changed to Uppercase and
also check for particular text, for example QUARTZ and SODA LIME.

Any help would be greatly appreciated.
Kind Regards
Harish

Private Sub Worksheet_Change(ByVal Target As Range)
       
   If Target.HasFormula = True Then
       Exit Sub
   End If
   If Target.Cells.Count > 1 Then
       Exit Sub
   End If
   Application.EnableEvents = False
   Target.Value = UCase(Target.Text)
   If Target.Value = "QUARTZ" Or Target.Value = "SODA LIME" Then
   
       Else
           MsgBox "Check the Spell"
           Target.Select
   End If
   Application.EnableEvents = True
   
End Sub
Doug Robbins - Word MVP - 04 Sep 2006 20:27 GMT
Much better if you post to microsoft.public.excel.programming than to
microsoft.public.word.vba.general.  The difference in the names of the
newsgroups should give you the reason why.

Signature

Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

> Hi All
>
[quoted text clipped - 31 lines]
>
> End Sub
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.