![]() |
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 |
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 |
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... |
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! |
All times are GMT +1. The time now is 01:22 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com