ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Finding a Date (https://www.excelbanter.com/excel-programming/368974-finding-date.html)

Marek

Finding a Date
 
Hi,

Am trying to find a date on an Excel spreadsheet - tried the Find function
as below:

Cells.Find(What:="01/08/06", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate

Problem is the date varies - hence the date needs to be in a variable.
Can't seem to get that part of it working - unsure of the syntax.

Anyone any ideas??
--
Many thanks in advance for any assistance

[email protected]

Finding a Date
 
Hi
Dim mydate as String
mydate = "01/08/06"
Cells.find(What:=mydate,......

regards
Paul

Marek wrote:
Hi,

Am trying to find a date on an Excel spreadsheet - tried the Find function
as below:

Cells.Find(What:="01/08/06", After:=ActiveCell, LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate

Problem is the date varies - hence the date needs to be in a variable.
Can't seem to get that part of it working - unsure of the syntax.

Anyone any ideas??
--
Many thanks in advance for any assistance



Bob Phillips

Finding a Date
 
I think you need to be careful with format, so perhaps

Dim mydate As Date
mydate = dateserial(2006,8,1)

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

wrote in message
oups.com...
Hi
Dim mydate as String
mydate = "01/08/06"
Cells.find(What:=mydate,......

regards
Paul

Marek wrote:
Hi,

Am trying to find a date on an Excel spreadsheet - tried the Find

function
as below:

Cells.Find(What:="01/08/06", After:=ActiveCell, LookIn:=xlValues,

LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate

Problem is the date varies - hence the date needs to be in a variable.
Can't seem to get that part of it working - unsure of the syntax.

Anyone any ideas??
--
Many thanks in advance for any assistance






All times are GMT +1. The time now is 09:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com