D
davegb
I wrote the following code:
Set wsCtyLst = Workbooks("Mark Top 10.xls").Worksheets("CtyLst")
Set wsSrc = ActiveSheet
'sWhichTop = _
'InputBox("Please enter 10 or 21 to determine which counties you want
extracted", , 10)
'REPLACE with code to determine which table to use
Set rCtyLst = wsCtyLst.Range("C2:C11")
Workbooks("Mark Top 10.xls").Activate
wsCtyLst.Select
rCtyLst.Select
Workbooks("Top Ten Extract Test.xls").Activate
sCtySrcCol = InputBox("Please enter the column where the counties are
currently listed", _
, "A")
sColMrk10 = InputBox("Please enter the column to mark the Top Ten
Counties", "E")
'TEST for valid entries on both variables
'TEST sColMrk10 for existing data
' TEST for county numbers/names or names
With wsSrc
Set rCtySrc = .Range(.Cells(2, sCtySrcCol), _
.Cells(2, sCtySrcCol).End(xlDown))
End With
wsSrc.Select
rCtySrc.Select
Set rFndCell = Cells.Find(What:=rCtyLst, _
After:=ActiveCell, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False)
I want it to start searching rCtySrc using the first value in rCtyLst,
but it uses the last value. How to I tell it to search from the top
down?
Thanks!
Set wsCtyLst = Workbooks("Mark Top 10.xls").Worksheets("CtyLst")
Set wsSrc = ActiveSheet
'sWhichTop = _
'InputBox("Please enter 10 or 21 to determine which counties you want
extracted", , 10)
'REPLACE with code to determine which table to use
Set rCtyLst = wsCtyLst.Range("C2:C11")
Workbooks("Mark Top 10.xls").Activate
wsCtyLst.Select
rCtyLst.Select
Workbooks("Top Ten Extract Test.xls").Activate
sCtySrcCol = InputBox("Please enter the column where the counties are
currently listed", _
, "A")
sColMrk10 = InputBox("Please enter the column to mark the Top Ten
Counties", "E")
'TEST for valid entries on both variables
'TEST sColMrk10 for existing data
' TEST for county numbers/names or names
With wsSrc
Set rCtySrc = .Range(.Cells(2, sCtySrcCol), _
.Cells(2, sCtySrcCol).End(xlDown))
End With
wsSrc.Select
rCtySrc.Select
Set rFndCell = Cells.Find(What:=rCtyLst, _
After:=ActiveCell, _
LookIn:=xlValues, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False)
I want it to start searching rCtySrc using the first value in rCtyLst,
but it uses the last value. How to I tell it to search from the top
down?
Thanks!