Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 361
Default Cells.Find Bug that's very strange

I hope someone can explain this as we're stratching our heads here.

I have named a string variable strCurrentDate that concatenates data
together to form the following date format: dd/mm/yyyy. What it is then
meant to do is go to a workbook and find that date in that format. So for
example 01/06/2007. The macro is getting as far as activating the workbook
and putting the date in the find function but is then coming back with:

Run-time error '91'
Object variable or with block variable not set

What is happening here? Why can't it find the date that I'm looking for?
When I stop the macro and go in to the workbook and hit Ctrl+F the date has
already been pasted in. If I simply press Find Next it finds it no problem.
So why does the macro stop before doing that? It is pointing at the correct
workbook and activating it so its no that.

Any help would be much appreciated.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default Cells.Find Bug that's very strange

You might want to paste your code into the thread so we can have a go at
debugging it.

Possibilities: you've put quotes around the date when you don't need to; you
haven't included every argument the Find code needs (try re-recording a macro
finding a sample date and use the whole of that line).



"carl" wrote:

I hope someone can explain this as we're stratching our heads here.

I have named a string variable strCurrentDate that concatenates data
together to form the following date format: dd/mm/yyyy. What it is then
meant to do is go to a workbook and find that date in that format. So for
example 01/06/2007. The macro is getting as far as activating the workbook
and putting the date in the find function but is then coming back with:

Run-time error '91'
Object variable or with block variable not set

What is happening here? Why can't it find the date that I'm looking for?
When I stop the macro and go in to the workbook and hit Ctrl+F the date has
already been pasted in. If I simply press Find Next it finds it no problem.
So why does the macro stop before doing that? It is pointing at the correct
workbook and activating it so its no that.

Any help would be much appreciated.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Cells.Find Bug that's very strange

Try Cells.Find(CDate(strCurrentDate))

"carl" wrote in message
...
I hope someone can explain this as we're stratching our heads here.

I have named a string variable strCurrentDate that concatenates data
together to form the following date format: dd/mm/yyyy. What it is then
meant to do is go to a workbook and find that date in that format. So for
example 01/06/2007. The macro is getting as far as activating the
workbook
and putting the date in the find function but is then coming back with:

Run-time error '91'
Object variable or with block variable not set

What is happening here? Why can't it find the date that I'm looking for?
When I stop the macro and go in to the workbook and hit Ctrl+F the date
has
already been pasted in. If I simply press Find Next it finds it no
problem.
So why does the macro stop before doing that? It is pointing at the
correct
workbook and activating it so its no that.

Any help would be much appreciated.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default Cells.Find Bug that's very strange

Did you sort out your problem, if your date system is International I rather
suspect you didn't.

Regards,
Peter T

"carl" wrote in message
...
I hope someone can explain this as we're stratching our heads here.

I have named a string variable strCurrentDate that concatenates data
together to form the following date format: dd/mm/yyyy. What it is then
meant to do is go to a workbook and find that date in that format. So for
example 01/06/2007. The macro is getting as far as activating the

workbook
and putting the date in the find function but is then coming back with:

Run-time error '91'
Object variable or with block variable not set

What is happening here? Why can't it find the date that I'm looking for?
When I stop the macro and go in to the workbook and hit Ctrl+F the date

has
already been pasted in. If I simply press Find Next it finds it no

problem.
So why does the macro stop before doing that? It is pointing at the

correct
workbook and activating it so its no that.

Any help would be much appreciated.



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
Strange, Irregular Merge of Cells dhunton Excel Discussion (Misc queries) 0 January 18th 07 08:26 PM
find and replace macro strange behaviour Nicawette Excel Discussion (Misc queries) 3 June 13th 06 08:49 PM
Strange AutoProtecting of cells Darin Kramer Excel Programming 0 March 2nd 05 09:27 AM
What is this Strange Characet? Find/Replace D[_6_] Excel Programming 12 November 25th 04 06:33 AM
Strange results using .FIND in Excel VBA Tom Ogilvy Excel Programming 0 August 6th 03 05:59 PM


All times are GMT +1. The time now is 01:52 AM.

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"