Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Find A value in a column and count the rows

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Find A value in a column and count the rows


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

"KWhamill" wrote:

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

Reply
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
Count to find the number of 100% 90% 80% in a column % Count Excel Discussion (Misc queries) 7 June 3rd 08 10:24 PM
Count all rows in column with data, Except rows 1-5 Gregory Day Excel Worksheet Functions 4 March 27th 08 02:58 PM
Find a value and count the rows back to the reference row. dlbeiler Excel Worksheet Functions 8 October 11th 07 07:40 PM
Find and Count Frequency of Numeric Value in Non-Contiguous Rows Sam via OfficeKB.com Excel Worksheet Functions 2 September 17th 06 09:17 PM
Rows Count of a particular column kaon[_24_] Excel Programming 2 August 2nd 04 12:20 PM


All times are GMT +1. The time now is 09:32 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"