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: 573
Default Not finding value, range method failing

I'm having at least 2 problems with the following code:

Set wCtyLstSht = Workbooks("Mark Top 10.xls").Worksheets("Sheet1")
Set wTrgtSht = ActiveSheet
Set rCtyLst = wCtyLstSht.Range("C2:C11")

sCtyCol = InputBox("Please enter the column where the counties are
currently listed", _
, "A")
sColMrk10 = InputBox("Please enter the column to mark the Top Ten
Counties")


' TEST for county numbers/names or names


For Each rCell In rCtyLst

wTrgtSht.Activate
Set rFndCell = Cells.Find(What:=rCell, After:=ActiveCell,
LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
_
MatchCase:=False)

If Not rFndCell Is Nothing Then
rCtyMrkr = wTrgtSht.Range(Cells(rFndCell.Row, sColMrk10))
<---ERROR

rCtyMrkr = "y"
End If

Next

End Sub

Range method is failing at the marked place. Can't figure out why.
A watch on rCell shows it is blank, but cell C2 in that worksheet
contains the text ADAMS (which is the value that I want to search the
other sheet for).
Any ideas?
Thanks again.

 
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
Select Method Failing cmk18[_8_] Excel Programming 2 July 11th 05 11:53 PM
Publish method failing, can't understand why Mark Excel Programming 0 June 22nd 05 07:52 PM
Excel Copy Method Failing. [email protected] Excel Programming 2 May 11th 05 06:01 PM
select method of range class failing ? mark kubicki Excel Programming 6 April 21st 05 05:38 PM
add method of validation failing mark kubicki Excel Programming 2 April 19th 05 08:08 PM


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