Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 623
Default Select cell with upper case letters

I need to clean up a file of imported data.

The rows that I want are where the text in the cell in Column A is in
uppercase. If there some formula in VBA which I can use to determine whether
I have all uppercase letters in a cell?

--
Thanks,
Fred



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Select cell with upper case letters

FVred,

Not a formula that I know of, but here is some VBA

Dim cLastRow As Long
Dim i As Long
Dim rng As Range

cLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To cLastRow
If Cells(i,"A").Value = UCase(Cells(i,"A").Value) Then
If rng Is Nothing Then
Set rng = Cells(i,"A")
Else
Set rng = Union(rng,Cells(i,"A"))
End If
End If
Next i
If Not rng Is Nothing Then
rng.Select
End If

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Fred Smith" wrote in message
...
I need to clean up a file of imported data.

The rows that I want are where the text in the cell in Column A is in
uppercase. If there some formula in VBA which I can use to determine

whether
I have all uppercase letters in a cell?

--
Thanks,
Fred





  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Select cell with upper case letters

Short answer:
tmpCell.Value = UCase(tmpCell.Value)

Longer answer:
Dim tmpRange As Range
Dim tmpCell As Range
Dim tmpColumn As Range

Set tmpRange = Workbooks("Book1").Worksheets("Sheet1").UsedRange

With tmpRange
For Each tmpCell In tmpRange.Rows(1).Cells
If tmpCell.Value = UCase(tmpCell.Value) Then
Set tmpColumn = tmpRange.Columns(tmpCell.Column)

MsgBox tmpColumn.Address
' perform actions on tmpColumn here...

End If
Next tmpCell
End With

Hope this helps...
~
~
~
:wq!
----------
"Fred Smith" wrote in message
...
I need to clean up a file of imported data.

The rows that I want are where the text in the cell in Column A is in
uppercase. If there some formula in VBA which I can use to determine

whether
I have all uppercase letters in a cell?

--
Thanks,
Fred





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 41
Default Select cell with upper case letters

Hi Fred
This should work:

If cells(10,1) = Ucase(cells(10,1)) then

do what you need to do

end if

Regards

Andrew Bourke



Fred Smith wrote:
I need to clean up a file of imported data.

The rows that I want are where the text in the cell in Column A is in
uppercase. If there some formula in VBA which I can use to determine whether
I have all uppercase letters in a cell?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Select cell with upper case letters

You could flag and sort them with a formula.

=EXACT(F2,UPPER(F2))


Regards
Robert McCurdy

"Fred Smith" wrote in message
...
I need to clean up a file of imported data.

The rows that I want are where the text in the cell in Column A is in
uppercase. If there some formula in VBA which I can use to determine
whether I have all uppercase letters in a cell?

--
Thanks,
Fred






  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Select cell with upper case letters



If x = UCase$(x) Then


On Sun, 6 Mar 2005 04:49:49 -0600, "Fred Smith" wrote:

I need to clean up a file of imported data.

The rows that I want are where the text in the cell in Column A is in
uppercase. If there some formula in VBA which I can use to determine whether
I have all uppercase letters in a cell?


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 863
Default Select cell with upper case letters

I'm sure you DO, Bob. It's just "one of those days" <g.

On Sun, 6 Mar 2005 13:13:41 -0000, "Bob Phillips"
wrote:

FVred,

Not a formula that I know of, but here is some VBA

Dim cLastRow As Long
Dim i As Long
Dim rng As Range

cLastRow = Cells(Rows.Count,"A").End(xlUp).Row
For i = 1 To cLastRow
If Cells(i,"A").Value = UCase(Cells(i,"A").Value) Then
If rng Is Nothing Then
Set rng = Cells(i,"A")
Else
Set rng = Union(rng,Cells(i,"A"))
End If
End If
Next i
If Not rng Is Nothing Then
rng.Select
End If


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
Upper Case Letters to First Letter Upper, Remaining Letters Lower SueW Excel Discussion (Misc queries) 7 February 25th 10 05:32 PM
find the upper case letters within a cell april Excel Discussion (Misc queries) 3 December 2nd 09 05:13 PM
upper case letters FOP38 Excel Worksheet Functions 5 June 2nd 08 08:42 AM
Upper Case Letters FOP38 Excel Discussion (Misc queries) 2 June 2nd 08 04:52 AM
need to make empty cell to type upper case letters chusu New Users to Excel 2 October 4th 07 08:37 AM


All times are GMT +1. The time now is 09:53 AM.

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"