Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove a cell from a range
How do you remove a cell (Range) from a range object.
I have a named range and I want to remove the selected cell from the range. IE. Range namedRange; // Contains selecedRange Range selecedRange; namedRange.Remove(selecedRange); Is this possible? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove a cell from a range
Re-Create & Dis-Invite:
This drops the cell B9 from a range: Sub divorce() Set r = Range("A1:Z100") ' ' we want to drop B9 from the range ' Set r2 = Nothing For Each rr In r If rr.Address < "$B$9" Then If r2 Is Nothing Then Set r2 = rr Else Set r2 = Union(r2, rr) End If End If Next Set r = r2 MsgBox (r.Address) End Sub -- Gary''s Student - gsnu200744 "C#_Programmer" wrote: How do you remove a cell (Range) from a range object. I have a named range and I want to remove the selected cell from the range. IE. Range namedRange; // Contains selecedRange Range selecedRange; namedRange.Remove(selecedRange); Is this possible? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Remove a cell from a range
Awesome... Thank you....
"Gary''s Student" wrote: Re-Create & Dis-Invite: This drops the cell B9 from a range: Sub divorce() Set r = Range("A1:Z100") ' ' we want to drop B9 from the range ' Set r2 = Nothing For Each rr In r If rr.Address < "$B$9" Then If r2 Is Nothing Then Set r2 = rr Else Set r2 = Union(r2, rr) End If End If Next Set r = r2 MsgBox (r.Address) End Sub -- Gary''s Student - gsnu200744 "C#_Programmer" wrote: How do you remove a cell (Range) from a range object. I have a named range and I want to remove the selected cell from the range. IE. Range namedRange; // Contains selecedRange Range selecedRange; namedRange.Remove(selecedRange); Is this possible? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to remove old sort range | Excel Discussion (Misc queries) | |||
Remove #VALUE! from ConCat Range Function | Excel Worksheet Functions | |||
How to remove borders in a range of cells? | Excel Programming | |||
Remove all borders from a range | Excel Programming | |||
Can I remove blanks from a range without using sort? | Excel Discussion (Misc queries) |