Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
using range name VB help
Hi
dim wb as workbook Set wb = ActiveWorkbook - This works.... set sh2 = worksheets("DSOCM") Set rng = sh2.Range(sh2.Cells(2, 1), sh2.Cells(Rows.Count, 1).End(xlUp)) the above range refers to range name created in workbook called "DSOCMC" ' range DSOCMC is a7:a7000 - BUT, can we not use Set rng = sh2.names("DSOCMC").ReferToRange (OR) Set rng = wb.names("DSOCMC").ReferToRange (or) or any method please................ I want to use range names instead of xlup /xldown, like that pl help. Eddy Stan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
using range name VB help
On 30 Lug, 23:21, Eddy Stan
wrote: Hi dim wb as workbook Set wb = ActiveWorkbook - This works.... set sh2 = worksheets("DSOCM") Set rng = sh2.Range(sh2.Cells(2, 1), sh2.Cells(Rows.Count, 1).End(xlUp)) the above range refers to range name created in workbook called "DSOCMC" ' range DSOCMC is a7:a7000 - BUT, can we not use Set rng = sh2.names("DSOCMC").ReferToRange * * (OR) Set rng = wb.names("DSOCMC").ReferToRange * * (or) or any method please................ I want to use range names instead of xlup /xldown, like that pl help. Eddy Stan Try: Public Sub prova() Dim sh2 As Worksheet Dim rng As Range Set sh2 = Worksheets("Foglio1") Set rng = sh2.UsedRange MsgBox rng.Address End Sub Regards Eliano |
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 |