ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   find date on other sheet (https://www.excelbanter.com/excel-programming/299984-find-date-other-sheet.html)

hans[_3_]

find date on other sheet
 
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



Frank Kabel

find date on other sheet
 
Hi
try something like
=VLOOKUP(DATE(2004,1,1),'other_sheet'!A1:C100,3,0)

--
Regards
Frank Kabel
Frankfurt, Germany


hans wrote:
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


hans[_3_]

find date on other sheet
 
oops sorry i need it in vba.

Greetings


"Frank Kabel" schreef in bericht
...
Hi
try something like
=VLOOKUP(DATE(2004,1,1),'other_sheet'!A1:C100,3,0)

--
Regards
Frank Kabel
Frankfurt, Germany


hans wrote:
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




Frank Kabel

find date on other sheet
 
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


--
Regards
Frank Kabel
Frankfurt, Germany


hans wrote:
oops sorry i need it in vba.

Greetings


"Frank Kabel" schreef in bericht
...
Hi
try something like
=VLOOKUP(DATE(2004,1,1),'other_sheet'!A1:C100,3,0)

--
Regards
Frank Kabel
Frankfurt, Germany


hans wrote:
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



Frank Kabel

find date on other sheet
 
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)

--
Regards
Frank Kabel
Frankfurt, Germany


Frank Kabel wrote:
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



hans wrote:
oops sorry i need it in vba.

Greetings


"Frank Kabel" schreef in bericht
...
Hi
try something like
=VLOOKUP(DATE(2004,1,1),'other_sheet'!A1:C100,3,0)

--
Regards
Frank Kabel
Frankfurt, Germany


hans wrote:
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




All times are GMT +1. The time now is 10:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com