Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to exclude a cell(s) from a range w/o mult. ranges on any fcn | Excel Worksheet Functions | |||
Sum a range but exclude and negative values | Excel Worksheet Functions | |||
Need to exclude certain cells in a range | Excel Worksheet Functions | |||
Exclude Header from Range? | Excel Discussion (Misc queries) | |||
Exclude blank cells from a range? | Excel Programming |