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: 19
Default Find doesn't find...what the !@#$

So, I have a fuction that should find the top and bottom row in column
A that has term Cat(j). However, the top works all the time and the
bottom only works when I specifically set it to A65535, otherwise its
A1. HELP:

dim Cat() as string
dim TabNames() as string
dim TopCell as Range
dim BottomCell as Range

Cat = GetCategories
TabNames = GetTabNames

for i = 0 to UBound(TabNames)
Set TopCell = Worksheets(TabNames(i)).Range("A1")
Set BottomCell = Worksheets(TabNames(i)).Range("A65535")
With Worksheets(TabNames(i)).Range("A:A")
for j = 0 to UBound(Cat)
Set TopCell
= .Find(What:=Cat(j),After:=TopCell,LookIn:=xlValues ,SearchOrder:=xlByRows,SearchDirection:=xlNext)
Set BottomCell = .Find(What:=Cat(j),After:=
BottomCell,LookIn:=xlValues,SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
next j
Next I
 
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 and Replace - delete the remainder of the text in the cell after my Find [email protected] Excel Programming 4 August 4th 07 03:39 AM
Find First Non blank cell than find column header and return that value Silver Rose Excel Worksheet Functions 10 April 30th 07 05:56 PM
find and delete duplicate entries in two columns or find and prin. campare 2 columns of numbers-find unique Excel Programming 1 November 24th 04 04:09 PM
find and delete text, find a 10-digit number and put it in a textbox Paul Excel Programming 3 November 16th 04 04:21 PM
backwards find function to find character in a string of text Ashleigh K. Excel Programming 1 January 14th 04 04:36 PM


All times are GMT +1. The time now is 06:42 AM.

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"