VBA Find Question

Emily

Active Member
Joined
Aug 28, 2002
Messages
304
The last two statement works in Office XP but not in Offce 2000, why?

Set FourWeeksCycle = Range("D9:AE9")
Set PHDate = Sheets("PH").Range("A2:A18")
For Each PHFind In FourWeeksCycle
If Application.CountIf(PHDate, PHFind.Value) = 1 Then 'Replace the code below
'Set f = PHDate.Find(PHFind, lookat:=xlPart
'If Not f Is Nothing Then
This message was edited by Emily on 2002-10-22 11:34
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Andrew Poulsom

MrExcel MVP
Joined
Jul 21, 2002
Messages
73,092
How are your dates formatted?

1. If dd/mm/yyyy it works with:

Set f = PHDate.Find(PHFind.Value, lookat:=xlPart)

2. If formatted as d-mmm-yy it works with:

Set f = PHDate.Find(PHFind.Text, lookat:=xlPart)

although I did have a problem in that 1-Oct-02 found 11-Oct-02. 2-Oct-02 was correct.

3. I could not get it to work with dd-mmm-yy.

Weird! If you ask me there are some serious
bugs with UK/European dates in Excel 2000.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,638
Messages
5,626,038
Members
416,155
Latest member
bokboxes

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
Top