Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm trying to select a range and name it but i just cant do it
The range isn't always the same, it can start in R5C1 and ends at R27C76, or R7C1 to R150C12. Range("A1").Select Selection.End(xlDown).Select ' this is where the data range begins Selection.End(xlDown).Select FirstRow = Selection.Row Selection.End(xlDown).Select LastRow = Selection.Row Range("A1").Select Selection.End(xlDown).Select Selection.End(xlDown).Select FirstColumn = Selection.Column Selection.End(xlToRight).Select LastColumn = Selection.Column After getting the range i would like to name it, like this ActiveWorkbook.Names.Add Name:="DataRange", RefersToR1C1:="=Sheet4!R5C1:R35C10" How can i set the ..., "RefersToR1C1:="=Sheet4!R5C1:R35C10"" to my DataRange selected above? I'm sure theres a very easy way to do this but i'm new in VBA Thanks PC |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
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 |