![]() |
VBA line of code executes in Immediate Window but not in Code Window
2003/2007
Using 2007 Dim StartSearch as Long (Value preceeding line below is 13) Dim FormulaStr as String (Value preceeding/after line below is 123] Application.DisplayAlerts = True Application.ScreenUpdating = True Application.Calculation = xlAutomatic StartSearch = IIf(InStr(StartSearch, FormulaStr, "'!") = InStr(StartSearch, FormulaStr, "'"), _ InStr(StartSearch, FormulaStr, "'!") + 2, InStr(StartSearch, FormulaStr, "'") + 1) In the Code Window, this line does not change the next StartSearch value from 13 to 46. Also, no error message is displayed. But if I copy/paste/execute the same line in the Immediate Window StartSearch chages from 13 to 46 as it should. What am I missing? or is there a Bug in 2007? TIA EagleOne |
VBA line of code executes in Immediate Window but not in Code Window
Hi,
Do you have a "sub..." /End sub? -- John johnf202 at hot mail dot com wrote in message ... 2003/2007 Using 2007 Dim StartSearch as Long (Value preceeding line below is 13) Dim FormulaStr as String (Value preceeding/after line below is 123] Application.DisplayAlerts = True Application.ScreenUpdating = True Application.Calculation = xlAutomatic StartSearch = IIf(InStr(StartSearch, FormulaStr, "'!") = InStr(StartSearch, FormulaStr, "'"), _ InStr(StartSearch, FormulaStr, "'!") + 2, InStr(StartSearch, FormulaStr, "'") + 1) In the Code Window, this line does not change the next StartSearch value from 13 to 46. Also, no error message is displayed. But if I copy/paste/execute the same line in the Immediate Window StartSearch chages from 13 to 46 as it should. What am I missing? or is there a Bug in 2007? TIA EagleOne |
All times are GMT +1. The time now is 02:17 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com