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 | |||
self-sizing adv.filter criteria range | Excel Discussion (Misc queries) | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Wrap Text Across Columns & Rows | Excel Discussion (Misc queries) | |||
Duplicate Range Names by worksheet | Excel Discussion (Misc queries) | |||
Help with using range names in sum function | Excel Worksheet Functions |