Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
a simple date match?? |:(
Hello experts,
I hope one of you ca help me out with something (very simple, probably...). On one sheet i have a date, and i want to lookup that date in a different sheet and get the row number. Ive tried a bunch of diffent matches, but i simply can get it to work.. Any help on this would be really appreciated! Thanks in Advance Leen best-code-so-far-that-ive-been-able-to-think-of : Sub test() Dim data_row As Integer dim date_val as string date_val= Cells(ActiveCell.Column) date_row = Application.Match(date_val, Worksheets("data").Range("B:B"), 0) MsgBox date_row End Sub |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
a simple date match?? |:(
I've actually managed to com up with something that works! (it did take
me quite a few hours in the end, despite these post -timestamps :) addr= Replace(Cells(1, ActiveCell.Column).Address, "$", "") date_row = Application.Match(Range(addr), Worksheets("data").Range("B:B"), 0) If anyone knows a better option, please do reply - dates in excel do seem to elude me! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
a simple date match?? |:(
dim res as Variant
Dim rng as Range res = Application.Match(clng(Cells(1,ActiveCell.Column). Value), _ Worksheets("Data").Range("B:B"),0) if iserror(res) then msgbox "Not found" exit sub end if set rng = Worksheets("Data").Cells(res,2) -- Regards, Tom Ogilvy wrote in message oups.com... I've actually managed to com up with something that works! (it did take me quite a few hours in the end, despite these post -timestamps :) addr= Replace(Cells(1, ActiveCell.Column).Address, "$", "") date_row = Application.Match(Range(addr), Worksheets("data").Range("B:B"), 0) If anyone knows a better option, please do reply - dates in excel do seem to elude me! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Very simple match function help | Excel Worksheet Functions | |||
Very simple match function help | Excel Worksheet Functions | |||
Very simple match function help | Excel Worksheet Functions | |||
Simple (?) Match question | Excel Worksheet Functions | |||
Simple match and link | Excel Worksheet Functions |