Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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
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
Very simple match function help Mike K Excel Worksheet Functions 1 March 28th 07 03:03 AM
Very simple match function help Teethless mama Excel Worksheet Functions 1 March 28th 07 02:05 AM
Very simple match function help Mike Excel Worksheet Functions 0 March 28th 07 01:12 AM
Simple (?) Match question Steve Excel Worksheet Functions 11 March 12th 07 05:22 PM
Simple match and link motol Excel Worksheet Functions 4 July 4th 06 03:06 AM


All times are GMT +1. The time now is 05:03 PM.

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"