LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Find method fails in hidden range


This is probably a question for for one Excel MVP's. I'm trying to find a
sub string in hidden range using the the Find method. If the sub string is
found the code is to make that Entire Row visible again. But everything I
have tried has failed. If I unhide the range everything works fines with
find method. My question is; Is it possible to use hidden range and still
manibulate data with in the hidden range, ie perform searches, change cell
formulas.......
I am using Excel 2000. A copy of test is below. Thank you time....

Rick


Option Explicit
Sub HideProjectRows()
Dim srcRng As Range, find As Range
Dim Str As String, FirstAddress As String
Dim lastRow As Long

Str = "899"
lastRow = Range("J2").End(xlDown).Row
Set srcRng = Range("J2:J" & lastRow)

srcRng.EntireRow.Hidden = True
Set find = srcRng.find(what:=Str, LookIn:=xlValues, lookat:=xlPart)
If Not find Is Nothing Then
FirstAddress = find.Address
Do
find.EntireRow.Hidden = False
find.EntireRow.Interior.ColorIndex = 54

Set find = srcRng.FindNext(find)

Loop While (Not find Is Nothing And find.Address < FirstAddress)

End If

End Sub


 
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
Set range with Find method jlclyde Excel Discussion (Misc queries) 1 December 3rd 08 05:44 PM
select method of range class fails mark kubicki Excel Programming 12 April 27th 05 02:37 PM
range.find method called into a VBA function (problem) Eros Pedrini Excel Programming 5 November 17th 04 12:34 PM
Select method of Range fails J West Excel Programming 1 June 7th 04 02:41 PM
Copy method fails in IIS Domien Excel Programming 0 February 19th 04 02:46 PM


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