Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Evaluate problem
This is an excerpt from some working code:
With Workbooks("stations.xls").Sheets("Sheet1") Here = ActiveWorkbook.Name: .Activate ' See what is going on StationRow = Application.Match(EndStation, .Range("$A$1:$A$298"), 0) s = .Cells(StationRow, OfficeHoursCol).Formula s = Evaluate(GetSub(s, "^=HYPERLINK.(.*), .Hours..$", "$1")) TxURL s When I comment the "Here = ..." line, the "s = Evaluate..." does not work as intended. When "Sheet1" is active "A40" is a reference to a cell in "Sheet1"; when inactive, it is a reference to whatever other sheet happens to be active. As it happens, the fix was easy. I commented the two "s =" lines, and inserted s = "http://www.journeyplanner.org/imr/XSLT_SOI_REQUEST?" & _ "language=en&itdLPxx_agent=ticketOffice&type=stop& id=" & _ .Cells(StationRow, JPcodesCol) I can probably do better when I think about it. At the moment, I am happy to have a fix. I would appreciate light on similar problems. I suspect it is a problem, already known to gurus here. I have been assuming that the sequence Here = ActiveWorkbook.Name: .Activate ' See what is going on <some code Windows(Here).Activate is equivalent to <some code -- Walter Briscoe |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Evaluate problem
"Walter Briscoe" je napisao u poruci
interesnoj ... This is an excerpt from some working code: With Workbooks("stations.xls").Sheets("Sheet1") Here = ActiveWorkbook.Name: .Activate ' See what is going on When I comment the "Here = ..." line, the "s = Evaluate..." does not work as intended. after 'name' there is a colon ':', is it intentional? colon ':' is a command separattor, so on that line you have actualy two commands, '.activate' being the second it is a bad practice, since program flow is not so clear |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
evaluate | Excel Worksheet Functions | |||
Why Evaluate? | Excel Programming | |||
Problem with Evaluate | Excel Programming | |||
HOW to Evaluate a range with IF ? | Excel Discussion (Misc queries) | |||
Evaluate or WorksheetFunction Problem | Excel Programming |