A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How can I search for words in all caps in Excel?



 
 
Thread Tools Display Modes
  #11  
Old November 28th, 2007, 12:48 AM posted to microsoft.public.excel.misc
NoelH
external usenet poster
 
Posts: 6
Default How can I search for words in all caps in Excel?

Hi T.

many thanks for the help, yes it worked
Noel


"T. Valko" wrote:

Try this:

Sub OnlyUpper()
Dim cell As Range
For Each cell In Selection
If cell.Value = UCase(cell.Value) Then
If cell.Value "" Then
cell.Font.ColorIndex = 3 'make font color = red
cell.Offset(0, 1).Value = 1
End If
End If
Next
End Sub

--
Biff
Microsoft Excel MVP


"NoelH" wrote in message
...
Hi Jason
I have found this old script and yes it works for me, However is it
possible
to have an addition part so that in addition to the Red colour, addtional
text text is added to another column.
Eg say the selection is in Column A, if the CAPS word is found in cell A2
then B2 has '1' placed in it. This would allow a filter to be setup on Col
B.

Many thanks for any help


"Jason Morin" wrote:

Select your data and run this macro:

Sub OnlyUpper()
Dim cell As Range
For Each cell In Selection
If cell.Value = UCase(cell.Value) Then
cell.Font.ColorIndex = 3 'make font color = red
End If
Next
End Sub

---
HTH
Jason
Atlanta, GA


"Nexan" wrote:

As part of a macro, I'd like to be able to identify and re-format only
cells
containing words in all caps. Is that doable?

Thanks!




  #13  
Old November 28th, 2007, 12:49 AM posted to microsoft.public.excel.misc
NoelH
external usenet poster
 
Posts: 6
Default How can I search for words in all caps in Excel?

Hi Gord
Thanks for the help
Yes this worked too.
Noel

"Gord Dibben" wrote:

Not Jason but here's a revision of his code.

Sub OnlyUpper()
Dim cell As Range
For Each cell In Selection
If cell.Value = UCase(cell.Value) Then
With cell
.Font.ColorIndex = 3 'make font color = red
.Offset(0, 1).Value = 1
End With
End If
Next
End Sub


Gord Dibben MS Excel MVP

On Tue, 27 Nov 2007 15:55:01 -0800, NoelH
wrote:

Hi Jason
I have found this old script and yes it works for me, However is it possible
to have an addition part so that in addition to the Red colour, addtional
text text is added to another column.
Eg say the selection is in Column A, if the CAPS word is found in cell A2
then B2 has '1' placed in it. This would allow a filter to be setup on Col B.

Many thanks for any help


"Jason Morin" wrote:

Select your data and run this macro:

Sub OnlyUpper()
Dim cell As Range
For Each cell In Selection
If cell.Value = UCase(cell.Value) Then
cell.Font.ColorIndex = 3 'make font color = red
End If
Next
End Sub

---
HTH
Jason
Atlanta, GA


"Nexan" wrote:

As part of a macro, I'd like to be able to identify and re-format only cells
containing words in all caps. Is that doable?

Thanks!



  #14  
Old November 28th, 2007, 12:58 AM posted to microsoft.public.excel.misc
T. Valko
external usenet poster
 
Posts: 15,759
Default How can I search for words in all caps in Excel?

You're welcome. Thanks for the feedback!

Note that I added a test for empty cells. The other replies did not. An
empty cell would get a 1. (if you might have empty cells in the range)

--
Biff
Microsoft Excel MVP


"NoelH" wrote in message
...
Hi T.

many thanks for the help, yes it worked
Noel


"T. Valko" wrote:

Try this:

Sub OnlyUpper()
Dim cell As Range
For Each cell In Selection
If cell.Value = UCase(cell.Value) Then
If cell.Value "" Then
cell.Font.ColorIndex = 3 'make font color = red
cell.Offset(0, 1).Value = 1
End If
End If
Next
End Sub

--
Biff
Microsoft Excel MVP


"NoelH" wrote in message
...
Hi Jason
I have found this old script and yes it works for me, However is it
possible
to have an addition part so that in addition to the Red colour,
addtional
text text is added to another column.
Eg say the selection is in Column A, if the CAPS word is found in cell
A2
then B2 has '1' placed in it. This would allow a filter to be setup on
Col
B.

Many thanks for any help


"Jason Morin" wrote:

Select your data and run this macro:

Sub OnlyUpper()
Dim cell As Range
For Each cell In Selection
If cell.Value = UCase(cell.Value) Then
cell.Font.ColorIndex = 3 'make font color = red
End If
Next
End Sub

---
HTH
Jason
Atlanta, GA


"Nexan" wrote:

As part of a macro, I'd like to be able to identify and re-format
only
cells
containing words in all caps. Is that doable?

Thanks!






 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how do I search by more than one criteria in excel? vulcan88 Worksheet Functions 2 March 15th, 2005 09:18 PM
Excel - How To Search For A Number In a Cell Containing Several Numbers John Worksheet Functions 1 April 29th, 2004 09:11 PM


All times are GMT +1. The time now is 03:05 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.