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: 27,285
Default Find row (and column)

Dim d as range
For n = 1 To i
With Range("B4:b369")
Set d = .Find(What:=dato(n), _
Lookin:=xlValues, Lookat:=xlPart, _
SearchDirection:=xlNext, _
MatchCase:=False)
If Not d Is Nothing Then
rad = d.Row
End If
End With
Next

Try doing the search manually and see if it is found. If you are looking
for a date, Find sometimes has a hard time with dates. Adjust the arguments
above to Find to match where and how find should look for the value.
Searching a single row would be no different.

--
Regards,
Tom Ogilvy


"Jon B" wrote in message
...
I am a newbie and need some help. I am trying to find the row and thats

match the value in Dato(n), but the code below does not work. It cannot find
the value that it is looking for. What can I have done wrong here.

My main purpose is really to find the row that match, but in addition I

would do the same for columns (With different values), so that I get the row
and column that match to criteria I have, so I will get the intersection
between the two. Maybe it is an easier way to find this.


For n = 1 To i
With Range("B4:b369")
Set d = .Find(dato(n))
If Not d Is Nothing Then
rad = d.Row
End If
End With
Next

I have "dimmed" d as Variant, and I know that this is not correct, what

kind of declaration should the d have.

Regards,

Jon



 
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 common data in one column then add number in adjacent column JT Excel Worksheet Functions 3 December 18th 09 10:20 PM
find last row value in column when using MATCH to find column Bouce Excel Worksheet Functions 6 February 6th 08 10:16 PM
Find something in column a then find if column B matches criteria Darrell_Sarrasin via OfficeKB.com Excel Discussion (Misc queries) 8 November 28th 07 09:40 PM
Find max value in one column and return the value of corrosponding cell in different column [email protected] Excel Worksheet Functions 5 October 16th 07 12:33 PM
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


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