#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Ucase / macros

hi, trying to get ucase to work, would settle for the 1 liner that works..
just to get the command to work, but don't see the answer anywhere that
combines a couple things (if have wording right):
- event macro, mixed in with other items, or
- reference to specific cells, columns
- similar, many different cells or multiple columns, whether:
- ucase, or lcase, thanks in advance

closest script have is for separate sheet entry guesse, but not working.
have: (can I get rid of private sub & option explicit have....)

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim myStr As String

With Target
If .Cells.Count 1 Then Exit Sub
If .HasFormula Then Exit Sub
If Intersect(.Cells, Me.Range("A:a")) Is Nothing Then
Exit Sub
On Error GoTo ErrHandler:

'If Not Intersect(Me.Range("A:A"), .Cells) Is Nothing Then

myStr = UCase(myStr)

Application.EnableEvents = False
.Value = myStr
End If
End With

ErrHandler:
Application.EnableEvents = True
End Sub



  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 34
Default Ucase / macros

found this that seems to work, modified so formula's not affected.

question: how to enter multiple ranges, columns & separate cell targets.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
With Target
If .Cells.Count 1 Then Exit Sub
If .HasFormula Then Exit Sub
If Not Intersect(Me.Range("A:A"), .Cells) Is Nothing Then

'If Not Application.Intersect(Range("a1:a20"), Target) Is Nothing Then
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
End If
End With
ErrHandler:
Application.EnableEvents = True
End Sub



(reference: Subject: convert lower to upper case automatically without
using UPPER, gord.. 10/31/2008 9:19 AM PST)

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
Macros: can you copy macros from one doc to another? Roady Excel Discussion (Misc queries) 1 June 12th 08 05:47 PM
Excel 2007 macros - how to merge 5 macros together into one Sue Excel Discussion (Misc queries) 1 April 16th 08 08:36 PM
Macros warning always shows up, even if all macros removed Joe M Excel Discussion (Misc queries) 1 December 20th 07 04:45 AM
Macros - copying macros from one computer to another TT Excel Discussion (Misc queries) 18 December 14th 06 03:24 AM
Training: More on how to use macros in Excel: Recording Macros ToriT Excel Worksheet Functions 2 February 10th 06 07:05 PM


All times are GMT +1. The time now is 05:47 PM.

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"