I have a series of Daily planner files that I am opening and copying the value of specific cells ($K$49 in this case represents # of hours worked) into a spreadsheet for comparison and analysis.
When I use the following snippet of code the first example puts the formula in the cell which results in data, but when I use Sum() on the hours shown I get a total of Zero. The 2nd example results in a Error 2023.
I am not a programmer, so I may not have included enough information in this post. But any help, suggestions or solutions would be most appreciated.
Thanks,
Charlie
----------------Example 1--------------------------
WorkbookName = "='" & Mid(Filename, 1, X - 1) & "[" & _
Mid(Filename, X, Len(Filename) - X + 1) & "]Charlie'"
Filename_Intime = WorkbookName & "!$K$49"
...
Range(Cells(DP_Row, Col_In), Cells(DP_Row, Col_In)).Formula = Filename_Intime
Results from Watch:
WorkbookName = "='G:\Cmills\Excel\Daily Planners\2004\May 2004\[Daily Planner 2004-05-14.xls]Charlie'"
Filename_Intime = "='G:\Cmills\Excel\Daily Planners\2004\May 2004\[Daily Planner 2004-05-14.xls]Charlie'!$K$49"
----------------Example 2--------------------------
WorkbookName = "'" & Mid(Filename, 1, X - 1) & "[" & _
Mid(Filename, X, Len(Filename) - X + 1) & "]Charlie'!$K$49"
Filename_Intime = Evaluate(WorkbookName1)
...
Range(Cells(DP_Row, Col_In), Cells(DP_Row, Col_In)).Value = Filename_Intime
Results from Watch:
WorkbookName = "'G:\Cmills\Excel\Daily Planners\2004\May 2004\[Daily Planner 2004-05-14.xls]Charlie!'$K$49"
Filename_Intime : Error 2023
When I use the following snippet of code the first example puts the formula in the cell which results in data, but when I use Sum() on the hours shown I get a total of Zero. The 2nd example results in a Error 2023.
I am not a programmer, so I may not have included enough information in this post. But any help, suggestions or solutions would be most appreciated.
Thanks,
Charlie
----------------Example 1--------------------------
WorkbookName = "='" & Mid(Filename, 1, X - 1) & "[" & _
Mid(Filename, X, Len(Filename) - X + 1) & "]Charlie'"
Filename_Intime = WorkbookName & "!$K$49"
...
Range(Cells(DP_Row, Col_In), Cells(DP_Row, Col_In)).Formula = Filename_Intime
Results from Watch:
WorkbookName = "='G:\Cmills\Excel\Daily Planners\2004\May 2004\[Daily Planner 2004-05-14.xls]Charlie'"
Filename_Intime = "='G:\Cmills\Excel\Daily Planners\2004\May 2004\[Daily Planner 2004-05-14.xls]Charlie'!$K$49"
----------------Example 2--------------------------
WorkbookName = "'" & Mid(Filename, 1, X - 1) & "[" & _
Mid(Filename, X, Len(Filename) - X + 1) & "]Charlie'!$K$49"
Filename_Intime = Evaluate(WorkbookName1)
...
Range(Cells(DP_Row, Col_In), Cells(DP_Row, Col_In)).Value = Filename_Intime
Results from Watch:
WorkbookName = "'G:\Cmills\Excel\Daily Planners\2004\May 2004\[Daily Planner 2004-05-14.xls]Charlie!'$K$49"
Filename_Intime : Error 2023