Serving the Quantitative Finance Community

 
User avatar
FangYi
Topic Author
Posts: 0
Joined: November 23rd, 2006, 8:44 am

Notation of excel range in VBA

June 18th, 2007, 9:06 am

Hi, sorry for this stupid question, please this is serious to me!There's a simple way to note an excel range in VBA, that is to put [] around the range name, for example:[RangeN] instead of range("RangeN").I have always been using this notation, but recently I've changed machine and it doesn't work anymore, I suppose that I should turn on a certain option to enable this.... would you please tell me how?Many thanks!
 
User avatar
adcockj
Posts: 1
Joined: July 14th, 2002, 3:00 am

Notation of excel range in VBA

June 19th, 2007, 10:45 am

There is no switch but the method does fail if there is a VBA variable with the same name in scope, so trying to do things likeSet RangeN = [RangeN] doesn't work, but Set myRangeN = [RangeN] does.John