View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
André André is offline
external usenet poster
 
Posts: 4
Default how to name a range with vba?

Thanks to all ..

"CLR" schreef in bericht
...
Sub NameRange()
Range("B5:B25").Select
ActiveWorkbook.Names.Add Name:="MyRange", RefersToR1C1:= _
"=Sheet1!R5C2:R25C2"
End Sub


Vaya con Dios,
Chuck, CABGx3



"Britt" wrote:

Hi,

I want to name a range of cells with vba.
I tried: range("b5:b25).name="myname"

but this gives an error.

Thanks
Britt