Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
CC CC is offline
external usenet poster
 
Posts: 91
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,058
Default 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
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
find & select Aaron Hodson \(Coversure\) Excel Worksheet Functions 2 August 21st 08 08:36 AM
How can i randomly select 780 rows from 4000 rows of data bbb Excel Worksheet Functions 2 July 6th 07 08:21 PM
Use find to select entire rows with a cell with that value Franky88 Excel Worksheet Functions 2 March 30th 07 06:38 PM
find and Select cells Richard Excel Discussion (Misc queries) 1 June 23rd 06 12:00 PM
Unable to select rows in the repeat rows on top option Noppie Excel Discussion (Misc queries) 2 December 28th 04 03:17 PM


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