Sub, not function!

  • Thread starter Thread starter Zurn
  • Start date Start date
Z

Zurn

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?
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top