Find A value in a column and count the rows

K

KWhamill

I am not making this up I have been asked to do the following: Create in VBA
such that the code finds a specified date in Column A and then counts the
Number of rows to it and then plugs that number into an Hlookup. So then the
Hlookup goes to that row and gets the appropriate value. so far i have the
following:
Step 1: Find in Column A the specified date that might be typed in a cell
somewhere else, say on the target spreadsheet. I'm sure i can do this part.
Step 2: count the rows from the top in which the date is found? actually now
that i think about it count the rows from the top of the Hlookup. I'm sure i
don't know how to do this.
Step 3 how do i plug this number into an Hlookup. do i just set the row
count equal to r and then stick r in the formula?
if anyone has anygood ideas or better ways of doing the same I'm all ears.
Thank you,
Karl
 
J

Joel

set c = Columns("A").Find(what:="abc",lookin:=xlvalues,lookat:=xlwhole_
if c is nothing then
msgbox("did not find abc")
else
msgbox("found abc at row : " & c.row)
end if
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top