View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Max length of variable name?

On Mon, 12 Apr 2010 09:49:01 -0700, David
wrote:

Hi,

Sorry if this appears twice, could not tell if first posted.

What is the maximun length of a varaible name?

x=1 not problem, but
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=2 this is too long, yes? How long can it be?

Thanks,


You did not write what type of variable you are using, or why you think
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=2 is "too long". That makes it difficult to
advise you.

Since this is the programming group, and most posting about variable names in
this group would be using VBA, then:

"Variable names must begin with an alphabetic character, must be unique within
the same scope, can't be longer than 255 characters, and can't contain an
embedded period or type-declaration character."

Since this works:

=======================
Sub foo()
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx = 2
Debug.Print xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
End Sub
======================

you are going to have to be more detailed in describing your problem.

--ron