Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Search for a column based on the column header and then past data from it to another column in another workbook | Excel Programming | |||
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 | Excel Programming | |||
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 | Excel Discussion (Misc queries) | |||
Loop through column headers to search from column name and get cell range | Excel Programming | |||
URGENT -- search in string for a value in another column, if found, return value from next column | Excel Programming |