Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Help with VBA Error
Tonight am I attempting to learn VBA and using a tutorial from jlathamsite.com.
It was all going well until I had to type up my first programme (module). The below code is producing an error which says "Expected: end of statement" and is highlighting raiseToPower as the location. MsgBox theNumber & " raised to the power of " raiseToPower & " = " theResult If it helps theNumber and raiseToPower are both Dim and are Integers. Thanks, Hat Last edited by HatStephens : February 26th 12 at 01:11 AM |
#2
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Help with VBA Error
On Sun, 26 Feb 2012 00:54:09 +0000, HatStephens wrote:
Tonight am I attempting to learn VBA and using a tutorial from jlathamsite.com. It was all going well until I had to type up my first programme (module). The below code is producing an error which says "Expected: end of statement" and is highlighting raiseToPower as the location. MsgBox theNumber & " raised to the power of " raiseToPower & " = " theResult If it helps theNumber and raiseToPower are both Dim and are Integers. Thanks, Hat You omitted an ampersand after the second quote mark. So the compiler thinks it should stop at that second quote mark, but since you have stuff on the line after that, which is not a comment, the error message is produced. MsgBox theNumber & " raised to the power of " & raiseToPower & " = " & theResult |
#3
Posted to microsoft.public.excel.newusers
|
|||
|
|||
Help with VBA Error
On Sun, 26 Feb 2012 00:54:09 +0000, HatStephens wrote:
MsgBox theNumber & " raised to the power of " raiseToPower & " = " theResult You forgot the ampersand before theResult. (I'm assuming in the original this was all on one line.) -- Stan Brown, Oak Road Systems, Tompkins County, New York, USA http://OakRoadSystems.com Shikata ga nai... |
#4
|
|||
|
|||
Thank you both so much!! I'm starting to get the hang of this.....well a little!
I'm sure i'll be posting here regularly! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
run time error 1004 general odbc error excel 2003 vba | Excel Programming | |||
Error handling error # 1004 Run-time error | Excel Programming | |||
Error Handling - On Error GoTo doesn't trap error successfully | Excel Programming | |||
Automation Error, Unknown Error. Error value - 440 | Excel Programming |