LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default using UCase

I want to have my input in column 2 to be all uppercase. It may include a
number or 1-5 letters in lowercase. I tried the solution offered by Rick
Rothstein to Michael Koerner, but when I cut & pasted that code into my code,
I get a request to choose one of my existing macros. The macros drop down
box appears.

Here is my macro code:

Sub Sort_A_to_Z(ByVal Target As Range)

If Target.Column = 2 Then
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
Application.EnableEvents = True
End If

ActiveWorkbook.Worksheets("Dividend Calc").ListObjects("Table14").Sort. _
SortFields.Clear
ActiveWorkbook.Worksheets("Dividend Calc").ListObjects("Table14").Sort. _
SortFields.Add Key:=Range("Table14[[#All],[Stock Sym]]"), SortOn:= _
xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Dividend
Calc").ListObjects("Table14").Sort
.Header = xlYes
' .MatchCase = False
.Orientation = xlTopToBottom
' .SortMethod = xlPinYin
.Apply
End With

Range("b1").Select
End Sub

If I insert this code instead of the "target column" code, I get all caps,
but if I have more than a single alpha character, it truncates to a single
character, rather than the 1-5 characters I might have entered.

For count = 0 To 23
Range("b3").Offset(count, 0) = UCase(Range("c3").Offset(count, 0))
Next count

I'm confused.
 
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
Ucase / macros MrDave Excel Discussion (Misc queries) 1 July 26th 09 11:07 AM
Use of UCase sylink[_3_] Excel Programming 4 November 18th 08 02:59 PM
UCase? vbastarter Excel Programming 4 March 13th 06 01:00 AM
UCase in textbox, help CAA[_4_] Excel Programming 10 December 18th 03 04:02 PM
UCase Help holder2k[_2_] Excel Programming 2 November 22nd 03 03:35 PM


All times are GMT +1. The time now is 07:24 AM.

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

About Us

"It's about Microsoft Excel"