Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find and Replace - delete the remainder of the text in the cell after my Find | Excel Programming | |||
Find First Non blank cell than find column header and return that value | Excel Worksheet Functions | |||
find and delete duplicate entries in two columns or find and prin. | Excel Programming | |||
find and delete text, find a 10-digit number and put it in a textbox | Excel Programming | |||
backwards find function to find character in a string of text | Excel Programming |