Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find date in another workbook

I need to find a date in Production Calendar.xls from Production Jo
List.xls. So far this is what I've got:

Workbooks("Productio
Calendar.xls").Worksheets("Phoenix").Range("A:G"). Cells
.Find(What:="9/24/2004", LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext
MatchCase:=False).Activate

message = CStr(ActiveCell.Location)



On the find statement I get an "Invalid or unqualified reference
error.

Actually, in the calendar itself the date is in format "24-Sep", no
sure if that matters or not since it's a date.

Any suggestions?

Thanks

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Find date in another workbook

I need to find a date in Production Calendar.xls from Production Job
List.xls. So far this is what I've got:

Workbooks("Production
Calendar.xls").Worksheets("Phoenix").Range("A:G"). Cells
Find(What:="9/24/2004", LookIn:=xlValues, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:=False).Activate

message = CStr(ActiveCell.Location)


On the find statement I get an "Invalid or unqualified reference"
error.

Actually, in the calendar itself the date is in format "24-Sep", not
sure if that matters or not since it's a date.


try this:

Sub FindDate()
Dim rngDate As Range

On Error Resume Next
Set rngDate = Workbooks("Production Calendar.xls").Worksheets("Phoenix") _
.Range("A:G").Cells.Find(#9/24/2004#)

If Not rngDate Is Nothing Then
MsgBox rngDate.Address
Else
MsgBox "Date not found"
End If
End Sub

--
Regards
Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find date in another workbook

Ok, I tried it exactly like that and it gave me a "Object Variable o
With block variable not set" error

--
Message posted from http://www.ExcelForum.com

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Find date in another workbook

Ok, I tried it exactly like that and it gave me a "Object Variable or
With block variable not set" error.


This error message cannot take place with the code, because
"On Error Resume Next" is set and the IF instruction is closed.

Did you examine whether is correctly written the file and sheet name?
Are the date values real, or generate by formulas ?

--
Regards
Melanie Breden
- Microsoft MVP für Excel -

http://excel.codebooks.de (Das Excel-VBA Codebook)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Find date in another workbook

it didn't stop the code, but when I stepped through it, it showed the
error.

Anyways, I did figure it out and now it's working how I need it to with
some proper formatting. :)


Thank you for your help!


---
Message posted from http://www.ExcelForum.com/

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
Find Specific date in Biwwekly Based on date jlclyde Excel Discussion (Misc queries) 3 January 27th 09 09:15 PM
Find cell in Excel2000 workbook with link from another workbook? Mark4mmx Excel Discussion (Misc queries) 1 October 8th 08 12:55 PM
RETRIEVE DATA FROM ANOTHER WORKBOOK BY CHECKING ON WORKBOOK DATE Joe Excel Worksheet Functions 13 May 27th 08 01:52 AM
Julian date - find next highest date/number jchick0909 Excel Worksheet Functions 1 March 20th 08 11:38 PM
Find the date of the coming up Saturday given the current date. Michael Ermino Excel Worksheet Functions 4 April 11th 07 02:48 AM


All times are GMT +1. The time now is 03:41 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"