Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
how to name a range with vba?
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 |
#2
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
how to name a range with vba?
Hi
you need to Set a range try Private Sub CommandButton1_Click() Dim myname As Range Set myname = Range("b5:b25") myname.Select End Sub S 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 |
#3
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
how to name a range with vba?
ActiveSheet.Names.Add Name:="MyName", RefersTo:="=$B$5:$B$25"
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 |
#4
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
how to name a range with vba?
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 |
#5
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
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 |
#6
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming
|
|||
|
|||
how to name a range with vba?
You missed a double quote:
range("b5:b25).name="myname" should be range("b5:b25").name="myname" 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 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I enter formula sum(range+range)*0.15 sumif(range=3) | Excel Discussion (Misc queries) | |||
Excel Addin:Setting the range to the Excel.Range object range prop | Excel Worksheet Functions | |||
Range Question / error 1004: method Range of object Worksheet has failed | Excel Programming | |||
Range.Find returns cell outside of range when range set to single cell | Excel Programming | |||
how to? set my range= my UDF argument (range vs. value in range) [advanced?] | Excel Programming |