Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is it possible to find the first value in a range that is not equal to a
value? I mean, aside from iterating through all the cells. I have a data set where there might be thousands of lines with a column value that rarely changes. What I would like, is to get the first value in a column, then search that column for the first occurance of a different value. Is there a way to do it with the Find method of the Range object? For Example: Dim rngColumnHeader as Range,rngSearchRange as Range Dim lngPowerSetting as Long, rngDifferent as Range 'Look for my column header Set rngColumnHeader = ActiveSheet.Find(What:="Power Setting", LookIn:=xlValues, LookAt:=xlWhole) If Not rngColumnHeader is Nothing Then 'If I find it, get the range to search Set rngSearchRange = ActiveSheet.Range(rngColumnHeader.Offset(1,0),rngC olumnHeader.End(xlDown)) lngPowerSetting = rngSearchRange.Cells(1).Value Set rngDifferent = rngSearchRange.Find(What:= ?,LookIn:=xlValues, LookAt:=xlWhole) 'What do I put in for the question mark to signify a value other than lngPowerSetting? If I do get a hit, I need to grab other values in the same row. Thanks, Bob P.S. My values are not sorted, and can go up or down. The test data set I have to work with has 80 columns with 9000 rows and about 20 columns I need to do this to. The Power Setting column in my test data set has about 3000 rows of 20, 500 rows of 50, 3000 rows of 20, and the rest 10. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
excel 2003 cannot find file | Excel Discussion (Misc queries) | |||
Excel 2003 SP3 - can't find the .cub files | Excel Discussion (Misc queries) | |||
how do i find the colors in excel 2003 | Setting up and Configuration of Excel | |||
Word 2003 Find/Change Automation from Excel 2003 crashes Excel 200 | Excel Programming | |||
Excel 2003 - Find records | Excel Worksheet Functions |