Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Creating a range

Hi,
is there anyway to create a range in memory like:
dim r as range
set r = new range
or I really need to set a range in a worksheet like:

set r = Worksheet("Sheet1").Range("Test")

Tks,

Marco


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Creating a range

Marco,

dim r as range
set r = new range

creates a range object, but doesn't actually assign it to a physical range.

so something like

set r = Worksheet("Sheet1").Range("Test")

is required to actually assign a range to the range object, and then
whenever you refer to r it implicitly refers to Test.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Marco Roberto" wrote in message
...
Hi,
is there anyway to create a range in memory like:
dim r as range
set r = new range
or I really need to set a range in a worksheet like:

set r = Worksheet("Sheet1").Range("Test")

Tks,

Marco




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Creating a range

Bob,

first of all, thaks for your reply. In fact, I don't want to refer to
Test. I just want to
create the range in memory and perform some operations with this range like:
input some
values, etc. I will use this range as a parameter to the DSum
worksheetfunction.

Tks

"Bob Phillips" wrote in message
...
Marco,

dim r as range
set r = new range

creates a range object, but doesn't actually assign it to a physical

range.

so something like

set r = Worksheet("Sheet1").Range("Test")

is required to actually assign a range to the range object, and then
whenever you refer to r it implicitly refers to Test.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Marco Roberto" wrote in message
...
Hi,
is there anyway to create a range in memory like:
dim r as range
set r = new range
or I really need to set a range in a worksheet like:

set r = Worksheet("Sheet1").Range("Test")

Tks,

Marco






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Creating a range

Marco,

I don't get it. As I said, in VBA you create a range object, it has to refer
to something otherwise it is null, and you can't do a lot with a null
object.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Marco Roberto" wrote in message
...
Bob,

first of all, thaks for your reply. In fact, I don't want to refer to
Test. I just want to
create the range in memory and perform some operations with this range

like:
input some
values, etc. I will use this range as a parameter to the DSum
worksheetfunction.

Tks

"Bob Phillips" wrote in message
...
Marco,

dim r as range
set r = new range

creates a range object, but doesn't actually assign it to a physical

range.

so something like

set r = Worksheet("Sheet1").Range("Test")

is required to actually assign a range to the range object, and then
whenever you refer to r it implicitly refers to Test.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Marco Roberto" wrote in message
...
Hi,
is there anyway to create a range in memory like:
dim r as range
set r = new range
or I really need to set a range in a worksheet like:

set r = Worksheet("Sheet1").Range("Test")

Tks,

Marco








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help creating a cost range tysonstone Excel Discussion (Misc queries) 5 September 15th 05 04:20 AM
Can I use named range in data range box when creating pie chart? BJackson Charts and Charting in Excel 2 August 17th 05 05:37 PM
Creating a Range object in .Net Gary[_14_] Excel Programming 0 January 6th 04 10:46 PM
Creating a Named Range using VB Adriaan van der Linde Excel Programming 4 December 5th 03 01:05 PM
Creating an XL Range on the fly Chris Parker Excel Programming 3 August 19th 03 01:09 PM


All times are GMT +1. The time now is 03:05 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"