Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default find cells based on its content's format

Does anyone know how to search for cells based on a text format.

below is an example:

Cell 1 - JACK JUMPED OVER
Cell 2 - -JILL FELL DOWN

i am trying to write a script that will search a specific column, once
it finds these cells all cells with all its contents in all CAPS, it
places an "x" in another specified column.

Any help would be great appreciated. :-)

PS. i know i can do a conditional find but i need to make it into a
script.

God bless
jsd219

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default find cells based on its content's format

Enter this small macro:

Sub case_check()
'gsnu 10_28_2006
Dim s As String, r As Range
For Each r In Selection
If r.Value = UCase(r.Value) Then
r.Offset(0, 1).Value = "x"
End If
Next
End Sub

Select the cells you want to check and run it. It uses the next column over
to do the marking, You can change the OFFSET() to get to any desired column.
--
Gary's Student


"jsd219" wrote:

Does anyone know how to search for cells based on a text format.

below is an example:

Cell 1 - JACK JUMPED OVER
Cell 2 - -JILL FELL DOWN

i am trying to write a script that will search a specific column, once
it finds these cells all cells with all its contents in all CAPS, it
places an "x" in another specified column.

Any help would be great appreciated. :-)

PS. i know i can do a conditional find but i need to make it into a
script.

God bless
jsd219


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default find cells based on its content's format

Thank you Gary;s Student,

I am checking column "N"

What i would like to do is select a cell in column "N" and have the
script run through the rest of column "N" to the end opf the spread
sheet but NOT go above where i selected.
i.e if my sheet is 5000 rows and I select "N200" i need the scrip to
start at N200 and go to N5000 but never check N199 - N1.

can you help me with this as well?

God bless
jsd219

Gary''s Student wrote:
Enter this small macro:

Sub case_check()
'gsnu 10_28_2006
Dim s As String, r As Range
For Each r In Selection
If r.Value = UCase(r.Value) Then
r.Offset(0, 1).Value = "x"
End If
Next
End Sub

Select the cells you want to check and run it. It uses the next column over
to do the marking, You can change the OFFSET() to get to any desired column.
--
Gary's Student


"jsd219" wrote:

Does anyone know how to search for cells based on a text format.

below is an example:

Cell 1 - JACK JUMPED OVER
Cell 2 - -JILL FELL DOWN

i am trying to write a script that will search a specific column, once
it finds these cells all cells with all its contents in all CAPS, it
places an "x" in another specified column.

Any help would be great appreciated. :-)

PS. i know i can do a conditional find but i need to make it into a
script.

God bless
jsd219



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default find cells based on its content's format

Sub case_check2()
'gsnu 10_28_2006
Dim s As String, r As Range

nlastrow = ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row - 1
myrow = Selection.Row
howmany = nlastrow - myrow

Set r2 = Range(Selection, Selection.Offset(howmany, 0))
r2.Select

For Each r In Selection
If r.Value = UCase(r.Value) Then
r.Offset(0, 1).Value = "x"
End If
Next
End Sub


In this version, you select a single cell and the code processes down the
column from where you indicated. The code will not look above your indicated
cell.
--
Gary's Student


"jsd219" wrote:

Thank you Gary;s Student,

I am checking column "N"

What i would like to do is select a cell in column "N" and have the
script run through the rest of column "N" to the end opf the spread
sheet but NOT go above where i selected.
i.e if my sheet is 5000 rows and I select "N200" i need the scrip to
start at N200 and go to N5000 but never check N199 - N1.

can you help me with this as well?

God bless
jsd219

Gary''s Student wrote:
Enter this small macro:

Sub case_check()
'gsnu 10_28_2006
Dim s As String, r As Range
For Each r In Selection
If r.Value = UCase(r.Value) Then
r.Offset(0, 1).Value = "x"
End If
Next
End Sub

Select the cells you want to check and run it. It uses the next column over
to do the marking, You can change the OFFSET() to get to any desired column.
--
Gary's Student


"jsd219" wrote:

Does anyone know how to search for cells based on a text format.

below is an example:

Cell 1 - JACK JUMPED OVER
Cell 2 - -JILL FELL DOWN

i am trying to write a script that will search a specific column, once
it finds these cells all cells with all its contents in all CAPS, it
places an "x" in another specified column.

Any help would be great appreciated. :-)

PS. i know i can do a conditional find but i need to make it into a
script.

God bless
jsd219




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default find cells based on its content's format

Thank you i really appreciate it. would by any chance mind explaining
the code for me. idon't understand the r2. what does the "2" represent?

God bless
jsd219


Gary''s Student wrote:
Sub case_check2()
'gsnu 10_28_2006
Dim s As String, r As Range

nlastrow = ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row - 1
myrow = Selection.Row
howmany = nlastrow - myrow

Set r2 = Range(Selection, Selection.Offset(howmany, 0))
r2.Select

For Each r In Selection
If r.Value = UCase(r.Value) Then
r.Offset(0, 1).Value = "x"
End If
Next
End Sub


In this version, you select a single cell and the code processes down the
column from where you indicated. The code will not look above your indicated
cell.
--
Gary's Student


"jsd219" wrote:

Thank you Gary;s Student,

I am checking column "N"

What i would like to do is select a cell in column "N" and have the
script run through the rest of column "N" to the end opf the spread
sheet but NOT go above where i selected.
i.e if my sheet is 5000 rows and I select "N200" i need the scrip to
start at N200 and go to N5000 but never check N199 - N1.

can you help me with this as well?

God bless
jsd219

Gary''s Student wrote:
Enter this small macro:

Sub case_check()
'gsnu 10_28_2006
Dim s As String, r As Range
For Each r In Selection
If r.Value = UCase(r.Value) Then
r.Offset(0, 1).Value = "x"
End If
Next
End Sub

Select the cells you want to check and run it. It uses the next column over
to do the marking, You can change the OFFSET() to get to any desired column.
--
Gary's Student


"jsd219" wrote:

Does anyone know how to search for cells based on a text format.

below is an example:

Cell 1 - JACK JUMPED OVER
Cell 2 - -JILL FELL DOWN

i am trying to write a script that will search a specific column, once
it finds these cells all cells with all its contents in all CAPS, it
places an "x" in another specified column.

Any help would be great appreciated. :-)

PS. i know i can do a conditional find but i need to make it into a
script.

God bless
jsd219







  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default find cells based on its content's format

The 2 is just part of the name of the variable. I could just as easily used
rtwo or r_two.
--
Gary's Student


"jsd219" wrote:

Thank you i really appreciate it. would by any chance mind explaining
the code for me. idon't understand the r2. what does the "2" represent?

God bless
jsd219


Gary''s Student wrote:
Sub case_check2()
'gsnu 10_28_2006
Dim s As String, r As Range

nlastrow = ActiveSheet.UsedRange.Rows.Count + ActiveSheet.UsedRange.Row - 1
myrow = Selection.Row
howmany = nlastrow - myrow

Set r2 = Range(Selection, Selection.Offset(howmany, 0))
r2.Select

For Each r In Selection
If r.Value = UCase(r.Value) Then
r.Offset(0, 1).Value = "x"
End If
Next
End Sub


In this version, you select a single cell and the code processes down the
column from where you indicated. The code will not look above your indicated
cell.
--
Gary's Student


"jsd219" wrote:

Thank you Gary;s Student,

I am checking column "N"

What i would like to do is select a cell in column "N" and have the
script run through the rest of column "N" to the end opf the spread
sheet but NOT go above where i selected.
i.e if my sheet is 5000 rows and I select "N200" i need the scrip to
start at N200 and go to N5000 but never check N199 - N1.

can you help me with this as well?

God bless
jsd219

Gary''s Student wrote:
Enter this small macro:

Sub case_check()
'gsnu 10_28_2006
Dim s As String, r As Range
For Each r In Selection
If r.Value = UCase(r.Value) Then
r.Offset(0, 1).Value = "x"
End If
Next
End Sub

Select the cells you want to check and run it. It uses the next column over
to do the marking, You can change the OFFSET() to get to any desired column.
--
Gary's Student


"jsd219" wrote:

Does anyone know how to search for cells based on a text format.

below is an example:

Cell 1 - JACK JUMPED OVER
Cell 2 - -JILL FELL DOWN

i am trying to write a script that will search a specific column, once
it finds these cells all cells with all its contents in all CAPS, it
places an "x" in another specified column.

Any help would be great appreciated. :-)

PS. i know i can do a conditional find but i need to make it into a
script.

God bless
jsd219






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
Conditional format based on other cells Tonto Excel Discussion (Misc queries) 3 October 14th 09 02:50 AM
Find and Replace based on neighboring cells? djc Excel Discussion (Misc queries) 4 December 5th 07 03:18 PM
Count of Cells Based on Format Dawg House Inc Excel Discussion (Misc queries) 1 August 15th 07 11:36 PM
how do i format a cell based on format of a range of cells? Chris Hardick Excel Discussion (Misc queries) 2 April 3rd 06 08:54 AM
how do you format a row of cells based upon a value in another ce. hazenb1 Excel Discussion (Misc queries) 1 December 9th 04 04:22 AM


All times are GMT +1. The time now is 11:33 PM.

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"