Stumped on a Find (Date) Code

fpskidmark

Board Regular
Joined
Sep 11, 2009
Messages
139
Hi Excel Guru,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
<o:p></o:p>
I'm having trouble with the code below:<o:p></o:p>
<o:p></o:p>
PHP:
Sheets("DaysOff").Activate
On Error Resume Next
lastrow = Range("bg113").End(xlUp).Row
For vv20 = 4 To lastrow
t = Sheets("DaysOff").Cells(vv20, "bg").Value
ee20 = Workbooks("RCO Schedule.xls").Sheets("2012").Range("c86:gd86").Find(t).Column: Workbooks("RCO Schedule.xls").Sheets("2012").Cells(161, ee20).FormulaR1C1 = "x"
Next vv20
<o:p></o:p>

<o:p></o:p>
The code works, but when T (the Date value) equals 1/1/2012, 1/2/2012, etc... "X" is populated on the November calendar (11/1/2012, 11/2/2012, etc). Why is that?<o:p></o:p>
<o:p></o:p>
I have tried to change the code to read: <o:p></o:p>
PHP:
ee20 = Workbooks("RCO Schedule.xls").Sheets("2012").Range("c86:gd86").Find(format(t, "mm/dd/yyyy").Column:
<o:p></o:p>

But it doesn't work.<o:p></o:p>
<o:p></o:p>
Any suggestions?<o:p></o:p>
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.

Forum statistics

Threads
1,224,518
Messages
6,179,254
Members
452,900
Latest member
LisaGo

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