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

I have two variables each defined as a Range say TotalRange and
SubRange. All the cells in SubRange fall within TotalRange.

Is there any way (without looping through the cells) to create a new
range from the above which contains all the cells in TotalRange which
do not fall into SubRange. (In other words the new range should be
TotalRange excluding SubRange)

Thanks
- Charl

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Exclude one range from another

I think it is possible
try this
Public Sub test()
'this removed data from subrange,that range will be blank
ActiveSheet.Range("subrange").ClearContents
'the nextline shifts the blanks to the last
ActiveSheet.Range("totalrange").Sort key1:=Range("a2")
End Sub
===========
--
remove $$$ from email addresss to send email




"Charl" wrote in message
oups.com...
I have two variables each defined as a Range say TotalRange and
SubRange. All the cells in SubRange fall within TotalRange.

Is there any way (without looping through the cells) to create a new
range from the above which contains all the cells in TotalRange which
do not fall into SubRange. (In other words the new range should be
TotalRange excluding SubRange)

Thanks
- Charl



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Exclude one range from another

Thanks, however I do not wish to delete the contents from SubRange - I
need to return a new range which contains TotalRange excluding SubRange
(all cell content needs to remain unchanged)

Regards
- Charl



R.VENKATARAMAN wrote:
I think it is possible
try this
Public Sub test()
'this removed data from subrange,that range will be blank
ActiveSheet.Range("subrange").ClearContents
'the nextline shifts the blanks to the last
ActiveSheet.Range("totalrange").Sort key1:=Range("a2")
End Sub
===========
--
remove $$$ from email addresss to send email




"Charl" wrote in message
oups.com...
I have two variables each defined as a Range say TotalRange and
SubRange. All the cells in SubRange fall within TotalRange.

Is there any way (without looping through the cells) to create a new
range from the above which contains all the cells in TotalRange which
do not fall into SubRange. (In other words the new range should be
TotalRange excluding SubRange)

Thanks
- Charl


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Exclude one range from another

Hi Charl,

The following NG thread maybe of interest:

http://tinyurl.com/bzohw


---
Regards,
Norman



"Charl" wrote in message
ups.com...
Thanks, however I do not wish to delete the contents from SubRange - I
need to return a new range which contains TotalRange excluding SubRange
(all cell content needs to remain unchanged)

Regards
- Charl



R.VENKATARAMAN wrote:
I think it is possible
try this
Public Sub test()
'this removed data from subrange,that range will be blank
ActiveSheet.Range("subrange").ClearContents
'the nextline shifts the blanks to the last
ActiveSheet.Range("totalrange").Sort key1:=Range("a2")
End Sub
===========
--
remove $$$ from email addresss to send email




"Charl" wrote in message
oups.com...
I have two variables each defined as a Range say TotalRange and
SubRange. All the cells in SubRange fall within TotalRange.

Is there any way (without looping through the cells) to create a new
range from the above which contains all the cells in TotalRange which
do not fall into SubRange. (In other words the new range should be
TotalRange excluding SubRange)

Thanks
- Charl




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
How to exclude a cell(s) from a range w/o mult. ranges on any fcn civileng Excel Worksheet Functions 2 April 25th 07 07:32 PM
Sum a range but exclude and negative values lister_d_000169 Excel Worksheet Functions 2 June 1st 06 02:49 PM
Need to exclude certain cells in a range Bob Smith Excel Worksheet Functions 3 May 5th 06 05:25 PM
Exclude Header from Range? nastech Excel Discussion (Misc queries) 4 December 30th 05 02:49 PM
Exclude blank cells from a range? achidsey Excel Programming 4 August 12th 05 02:45 AM


All times are GMT +1. The time now is 02:37 PM.

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"