find date on other sheet

  • Thread starter Thread starter hans
  • Start date Start date
H

hans

Can someone tell me how i can find a date on another sheet and if it is
found select the colorvalue two cells to the right.

Greetings Hans
 
Hi
try something like
=VLOOKUP(DATE(2004,1,1),'other_sheet'!A1:C100,3,0)
 
Hi
o.k. try
sub foo()
dim source_rng as range
dim lookup_value
dim ret_value
set source_rng = worksheets("other_sheet").range("A1:C100")
lookup_value=dateserial(2004,1,1)
ret_value=application.vlookup(lookup_value,source_rng,2,0)
if iserror(ret_value) then
msgbox "Date not found"
else
msgbox "Found value: " & ret_value
end if
end sub
 
Hi
sorry, you wanted the cell 2 columns to the right. So use the statement
ret_value=application.vlookup(lookup_value,source_rng,3,0)
 

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

Back
Top