ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sub, not function! (https://www.excelbanter.com/excel-programming/311556-sub-not-function.html)

Zurn[_5_]

Sub, not function!
 

Still I get the message:

COMPILE ERROR:
EXPECTED:


PutOnReport("B" & leftChoise * 22 - 15, "A5")
PutOnReport("B" & rightChoise * 22 - 15, "M5")

PutOnReport is a method that puts values from two tests on shee
Report, one test on the left, another on the right.

LeftChoise is the test chosen to be on the left, rightchoise on th
right
A5 is the cell on sheet Report where data from the leftchoise has to b
put, M5 for the right choise.

*why do I get this message and how correct it?

--
Zur
-----------------------------------------------------------------------
Zurn's Profile: http://www.excelforum.com/member.php...fo&userid=1464
View this thread: http://www.excelforum.com/showthread.php?threadid=26374


Chip Pearson

Sub, not function!
 
When calling a Sub procedure, don't enclose the arguments in
parentheses. E.g. change

PutOnReport("B" & leftChoise * 22 - 15, "A5")
' to
PutOnReport "B" & leftChoise * 22 - 15, "A5"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Zurn" wrote in message
...

Still I get the message:

COMPILE ERROR:
EXPECTED: =


PutOnReport("B" & leftChoise * 22 - 15, "A5")
PutOnReport("B" & rightChoise * 22 - 15, "M5")

PutOnReport is a method that puts values from two tests on
sheet
Report, one test on the left, another on the right.

LeftChoise is the test chosen to be on the left, rightchoise on
the
right
A5 is the cell on sheet Report where data from the leftchoise
has to be
put, M5 for the right choise.

*why do I get this message and how correct it?*


--
Zurn
------------------------------------------------------------------------
Zurn's Profile:
http://www.excelforum.com/member.php...o&userid=14645
View this thread:
http://www.excelforum.com/showthread...hreadid=263742





All times are GMT +1. The time now is 12:08 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com