Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default opposite of Union

Hi.

I have a range name which defines a bunch of discontiguous cells... probably
100 or more.

Unfortunately, I have one cell, BR8, which is included in this defined range
name, which should not be.

I've tried getting access to the address of all of the cells defined by this
range name, so that I can have a program select all but that one, to redefine
the range name.

But, the Selection.Address property, and the Names(i).RefersTo property only
provide a small portion of the actual list of addresses involved.

What I'd like is the opposite of a Union..... sort of like an
OppositeUnion(rgRange,"BR8"), which would deselect BR8 from the selection, so
that I could then rename the proper set of cells.

I could go through and manually re-select all of the proper cells, but is
there an easier way?

Thanks,
Mark
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 434
Default opposite of Union

hi, Mark !

i'm afraid you need to "divorce" (or slice) that cell/range and make another union
(i.e.) using range objects (or adapt/modify/... to work with its address) -?-

Private Function Slice(Where As Range, Which As Range) As Range
Dim xCell As Range
For Each xCell In Where
If Intersect(xCell, Which) Is Nothing Then _
Set Slice = Union(IIf(Slice Is Nothing, xCell, Slice), xCell)
Next
End Function

hth,
hector.

__ OP __
I have a range name which defines a bunch of discontiguous cells... probably 100 or more.
Unfortunately, I have one cell, BR8, which is included in this defined range name, which should not be.
I've tried getting access to the address of all of the cells defined by this range name
so that I can have a program select all but that one, to redefine the range name.
But, the Selection.Address property, and the Names(i).RefersTo property only provide a small portion of the actual list of addresses involved.
What I'd like is the opposite of a Union..... sort of like an OppositeUnion(rgRange,"BR8")
which would deselect BR8 from the selection, so that I could then rename the proper set of cells.
I could go through and manually re-select all of the proper cells, but is there an easier way?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default opposite of Union

Check your other post.

mark wrote:

Hi.

I have a range name which defines a bunch of discontiguous cells... probably
100 or more.

Unfortunately, I have one cell, BR8, which is included in this defined range
name, which should not be.

I've tried getting access to the address of all of the cells defined by this
range name, so that I can have a program select all but that one, to redefine
the range name.

But, the Selection.Address property, and the Names(i).RefersTo property only
provide a small portion of the actual list of addresses involved.

What I'd like is the opposite of a Union..... sort of like an
OppositeUnion(rgRange,"BR8"), which would deselect BR8 from the selection, so
that I could then rename the proper set of cells.

I could go through and manually re-select all of the proper cells, but is
there an easier way?

Thanks,
Mark


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 989
Default opposite of Union

Thanks, guys. I got it working from looping through the cells, as suggested
in the other post.

Sorry about the double post, I know that's usually bad form.

I tried to post this first one just before leaving work yesterday, but then
a couple hours later at home, I didn't see this post.... not sure what
happened to it. Maybe I just missed it.

Anyway, since I couldn't find this one, I posted the second one.

Thanks for the help.

"mark" wrote:

Hi.

I have a range name which defines a bunch of discontiguous cells... probably
100 or more.

Unfortunately, I have one cell, BR8, which is included in this defined range
name, which should not be.

I've tried getting access to the address of all of the cells defined by this
range name, so that I can have a program select all but that one, to redefine
the range name.

But, the Selection.Address property, and the Names(i).RefersTo property only
provide a small portion of the actual list of addresses involved.

What I'd like is the opposite of a Union..... sort of like an
OppositeUnion(rgRange,"BR8"), which would deselect BR8 from the selection, so
that I could then rename the proper set of cells.

I could go through and manually re-select all of the proper cells, but is
there an easier way?

Thanks,
Mark

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
Opposite direction Branko Pecar Excel Worksheet Functions 9 November 25th 09 05:47 AM
Opposite of Countifs Steve Excel Worksheet Functions 2 October 11th 09 03:45 AM
Opposite of a marco JBoyer Excel Programming 7 April 15th 09 11:41 PM
Now I want the opposite David Excel Programming 2 June 13th 06 09:49 PM
What is the function opposite of LOG erik Excel Worksheet Functions 0 January 27th 06 03:41 AM


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

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

About Us

"It's about Microsoft Excel"