Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Find Specific date in Biwwekly Based on date | Excel Discussion (Misc queries) | |||
Find cell in Excel2000 workbook with link from another workbook? | Excel Discussion (Misc queries) | |||
RETRIEVE DATA FROM ANOTHER WORKBOOK BY CHECKING ON WORKBOOK DATE | Excel Worksheet Functions | |||
Julian date - find next highest date/number | Excel Worksheet Functions | |||
Find the date of the coming up Saturday given the current date. | Excel Worksheet Functions |