Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trouble Naming Range
Having trouble naming a range...
Dim rng as Range Set Rng..... I need rng to be the length of my sheet...trying to name it and its failing on me. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trouble Naming Range
Hi
Do you mean this(example for the A column) Sub test() Dim rng As Range Set rng = Sheets("sheet1").Range("A1:A" & Sheets(1).Range("A" & Rows.Count).End(xlUp).Row) MsgBox rng.Address End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "Michael Smith" wrote in message ... Having trouble naming a range... Dim rng as Range Set Rng..... I need rng to be the length of my sheet...trying to name it and its failing on me. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trouble Naming Range
Dim rng as Range, i as Long
' set i to the column you need i = 3 set rng = Range(cells(1,i),cells(rows.count,i).End(xlup)) rng.Name = "MyName" msgbox Range("MyName").Address(external:=True) msgbox Thisworkbook.Names("MyName") _ .RefersToRange.Address(external:=True) -- Regards, Tom Ogilvy "Michael Smith" wrote in message ... Having trouble naming a range... Dim rng as Range Set Rng..... I need rng to be the length of my sheet...trying to name it and its failing on me. *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Trouble Naming Range
that was it! Thanks mucho *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Naming a range | Excel Discussion (Misc queries) | |||
Naming a range | Excel Programming | |||
VB Code Naming a Range (range changes each time) | Excel Programming | |||
Naming a range | Excel Programming | |||
Naming a Range with VB | Excel Programming |