View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Error resulting from coding

Jim,

What it means is that the parser has come to the end and it hasn't been able
to fully resolve the statement, it expects something else. Often happens
with parentheses, but in this case it needed to be told to do something to
the range defined, but it wasn't happy with what it got.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jim May" wrote in message
news:VM0Bd.15530$jn.310@lakeread06...
an additional (important) lesson for me which I need to know... Question?
Any time one sees the comment:
Expected: End of Statement
...loosely translated - does this mean "you have stopped too soon (with
what's needed)?"
as was the case with me in failing to "tack-on" .name = "TestRange"
Thanks again,
Jim

"Bob Phillips" wrote in message
...
Becuase you are not declaring a variable.

I assume that you want to redefine the name, so try

Range("TestRange").Resize(5,3).Name="TestRange"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Jim May" wrote in message
news:ND%Ad.15517$jn.4876@lakeread06...
In a new wb and ws:
In the Immediate Window I enter:
range("A1:A10").Name = "TestRange"
? Range("TestRange").address
$A$1:$A$10 <<< results of above line
Range("TestRange").Resize(5,3) As Range << When I enter this I get

Compile error:

Expected: End of Statement

Why?