Thread: Naming a range
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Alan Beban[_2_] Alan Beban[_2_] is offline
external usenet poster
 
Posts: 783
Default Naming a range

Sheets("whatever").Range("D61:D96, D101:D136, D141:D176").Name = "rnga"

Alan Beban

Andrew B wrote:

Hi
I would like to define a range like this:
rnga = Range("D61:D96", "D101:D136", "D141:D176").

So I can use it in a spreadsheet formula such as this formula typed into
cell D40:

[D40] = STDEVP(rnga)

I know I can use INSERT - NAME - DEFINE to define rnga but I would like
to be able to do this through VBA.

Is this possible ?

Thanks in advance

Andrew Bourke