Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
SELECT ALL ROWS IF FIND
I have this code to select the entire row if find a word in column H
Is it possible select ALL ROWS if the the word that I search is in more than one row ( the same column H ) thank you for yor help cc Sub Rowshow1() Dim k As Long, myWord As String myWord = InputBox("Word to find?") If myWord < "" Then For k = Cells(Rows.Count, "H").End(xlUp).Row To 1 Step -1 If InStr(1, CStr(Cells(k, "H")), myWord, vbTextCompare) Then Rows(k).EntireRow.Select End If Next k End If End Sub |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
SELECT ALL ROWS IF FIND
Check your other post.
CC wrote: I have this code to select the entire row if find a word in column H Is it possible select ALL ROWS if the the word that I search is in more than one row ( the same column H ) thank you for yor help cc Sub Rowshow1() Dim k As Long, myWord As String myWord = InputBox("Word to find?") If myWord < "" Then For k = Cells(Rows.Count, "H").End(xlUp).Row To 1 Step -1 If InStr(1, CStr(Cells(k, "H")), myWord, vbTextCompare) Then Rows(k).EntireRow.Select End If Next k End If End Sub -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
SELECT ALL ROWS IF FIND
Sub Rowshow1()
Dim AllOfThem As Range Dim k As Long, myWord As String myWord = InputBox("Word to find?") If myWord < "" Then For k = Cells(Rows.Count, "H").End(xlUp).Row To 1 Step -1 If InStr(1, CStr(Cells(k, "H")), myWord, vbTextCompare) Then If AllOfThem Is Nothing Then Set AllOfThem = Rows(k).EntireRow Else Set AllOfThem = Union(AllOfThem, Rows(k).EntireRow) End If End If Next k End If AllOfThem.Select End Sub -- Gary''s Student - gsnu200907 "CC" wrote: I have this code to select the entire row if find a word in column H Is it possible select ALL ROWS if the the word that I search is in more than one row ( the same column H ) thank you for yor help cc Sub Rowshow1() Dim k As Long, myWord As String myWord = InputBox("Word to find?") If myWord < "" Then For k = Cells(Rows.Count, "H").End(xlUp).Row To 1 Step -1 If InStr(1, CStr(Cells(k, "H")), myWord, vbTextCompare) Then Rows(k).EntireRow.Select End If Next k End If End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
find & select | Excel Worksheet Functions | |||
How can i randomly select 780 rows from 4000 rows of data | Excel Worksheet Functions | |||
Use find to select entire rows with a cell with that value | Excel Worksheet Functions | |||
find and Select cells | Excel Discussion (Misc queries) | |||
Unable to select rows in the repeat rows on top option | Excel Discussion (Misc queries) |