Find date on another spreadsheet

jiddings

Board Regular
Joined
Nov 22, 2008
Messages
135
I'm confused on how to find a date in a column using VBA. Is there a special format statement that I need to use for the dates?
My problem:
I have a date in cell F17 in my source workbook. I want to find that date in my target workbook column A and return the row number.
I'd appreciate any help.... Thanks

Using Excel 2007

Thanks
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
Didn't need VBA as Match formula will work.

In cell G17 add this formula.

=MATCH(F17,[Book3]Sheet1!$A:$A,0)

Sample of both

Excel Workbook
A
601/07/2011
702/07/2011
803/07/2011
904/07/2011
1005/07/2011
1106/07/2011
1207/07/2011
1308/07/2011
1409/07/2011
1510/07/2011
Sheet1

Formula in another workbook

Excel Workbook
FG
1701/07/20116
Sheet1
 
Upvote 0
Trevor,
Thanks for the response.
I was attempting to do it in vba as two workbooks are involved.
I did figure out the vba. I overlooked the dates were values (each day of the year plus one from Jan. 1) and I needed to get values not dates.
 
Upvote 0
IF you want to use the VBA then you need to jsut change the format of the cell to show the number rather than date.

Excel Workbook
C
209/08/2011
Sheet2

Becomes

Excel Workbook
C
240764
Sheet2

Code used

<font face=Courier New><SPAN style="color:#00007F">Sub</SPAN> Macro2()<br><SPAN style="color:#007F00">'</SPAN><br>    Range("C2").NumberFormat = "0"<br><SPAN style="color:#00007F">End</SPAN> <SPAN style="color:#00007F">Sub</SPAN></FONT>
 
Upvote 0

Forum statistics

Threads
1,224,506
Messages
6,179,156
Members
452,892
Latest member
yadavagiri

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top