Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Search column for a value

I am searching a column of values for a specific value.
How can I search for case sensitive data values?

Here is the code I am using;
Do Until ActiveCell = ""
If ActiveCell = strSearch Then
bolFound = True
Exit Sub
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Search column for a value

You code is already case sensitive if you have added a line like

Option Compare Text

at the top of the module


ActiveCell = strSearch

is a case sensitive comparison.

to demo from the immediate window:

? "ABC" = "abc"
False
? "ABC" = "ABC"
True

--
Regards,
Tom Ogilvy



"JRForm" wrote:

I am searching a column of values for a specific value.
How can I search for case sensitive data values?

Here is the code I am using;
Do Until ActiveCell = ""
If ActiveCell = strSearch Then
bolFound = True
Exit Sub
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Search column for a value

How about this... You can change xlFormulas/xlValues, xlPart/xlWhole,
MatchCase True/False...

Sub FindStuff()
Dim rngFound As Range
Dim strSearch As String

strSearch = "Tada"
Set rngFound = Columns("B").Find(What:=strSearch, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
MatchCase:=True)
If Not rngFound Is Nothing Then rngFound.Select
End Sub
--
HTH...

Jim Thomlinson


"JRForm" wrote:

I am searching a column of values for a specific value.
How can I search for case sensitive data values?

Here is the code I am using;
Do Until ActiveCell = ""
If ActiveCell = strSearch Then
bolFound = True
Exit Sub
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Search column for a value

This line
You code is already case sensitive if you have added a line like
should say

Your code is already case sensitive if you have NOT added a line like

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote:

You code is already case sensitive if you have added a line like

Option Compare Text

at the top of the module


ActiveCell = strSearch

is a case sensitive comparison.

to demo from the immediate window:

? "ABC" = "abc"
False
? "ABC" = "ABC"
True

--
Regards,
Tom Ogilvy



"JRForm" wrote:

I am searching a column of values for a specific value.
How can I search for case sensitive data values?

Here is the code I am using;
Do Until ActiveCell = ""
If ActiveCell = strSearch Then
bolFound = True
Exit Sub
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

Thanks

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Search column for a value

Thank you :)

"Tom Ogilvy" wrote:

You code is already case sensitive if you have added a line like

Option Compare Text

at the top of the module


ActiveCell = strSearch

is a case sensitive comparison.

to demo from the immediate window:

? "ABC" = "abc"
False
? "ABC" = "ABC"
True

--
Regards,
Tom Ogilvy



"JRForm" wrote:

I am searching a column of values for a specific value.
How can I search for case sensitive data values?

Here is the code I am using;
Do Until ActiveCell = ""
If ActiveCell = strSearch Then
bolFound = True
Exit Sub
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

Thanks



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 130
Default Search column for a value

Thank you:)


"Jim Thomlinson" wrote:

How about this... You can change xlFormulas/xlValues, xlPart/xlWhole,
MatchCase True/False...

Sub FindStuff()
Dim rngFound As Range
Dim strSearch As String

strSearch = "Tada"
Set rngFound = Columns("B").Find(What:=strSearch, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
MatchCase:=True)
If Not rngFound Is Nothing Then rngFound.Select
End Sub
--
HTH...

Jim Thomlinson


"JRForm" wrote:

I am searching a column of values for a specific value.
How can I search for case sensitive data values?

Here is the code I am using;
Do Until ActiveCell = ""
If ActiveCell = strSearch Then
bolFound = True
Exit Sub
Else
ActiveCell.Offset(1, 0).Select
End If
Loop

Thanks

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
Search for a column based on the column header and then past data from it to another column in another workbook minkokiss Excel Programming 2 April 5th 07 01:12 AM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look [email protected] Excel Programming 2 December 30th 06 06:23 PM
Based on a condition in one column, search for a year in another column, and display data from another column in the same row look [email protected] Excel Discussion (Misc queries) 1 December 27th 06 05:47 PM
Loop through column headers to search from column name and get cell range Pie Excel Programming 9 December 29th 05 12:17 AM
URGENT -- search in string for a value in another column, if found, return value from next column samkshah Excel Programming 4 October 3rd 05 04:13 PM


All times are GMT +1. The time now is 02:54 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"