x404.co.uk http://www.x404.co.uk/forum/ |
|
Excel 2003 Return statment won't work? http://www.x404.co.uk/forum/viewtopic.php?f=4&t=2213 |
Page 1 of 1 |
Author: | forquare1 [ Mon Aug 10, 2009 12:51 pm ] | ||||||||||||||||||
Post subject: | Excel 2003 Return statment won't work? | ||||||||||||||||||
Hi all, I've got this code in a Macro within Excel 2003 (VB 6.3)
I want to return the selected text rather than copying it. I added this to the bottom of my function:
However it highlights "Selection" and comes up with a syntax error. I've swapped it for "Hello" (With quotes) and "myText" which was a string variable, but I keep ketting syntax errors (no more helpful than that... Can anyone help? Many thanks, Ben |
Author: | big_D [ Mon Aug 10, 2009 3:45 pm ] | |||||||||
Post subject: | Re: Excel 2003 Return statment won't work? | |||||||||
Return doesn't take parameters! This is VisualBasic, not C or Java. You need to assign the string to "level1".
|
Author: | forquare1 [ Mon Aug 10, 2009 5:21 pm ] |
Post subject: | Re: Excel 2003 Return statment won't work? |
Thanks Dave, I should have deleted the topic, I worked around it by using global variables (ouch). For what I want it should be fine, and thankfully once I leave the code should never be needed again, so there should be little chance of anything bad happening from it. |
Page 1 of 1 | All times are UTC |
Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |