![]() |
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? |
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? |
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? |
All times are GMT +1. The time now is 09:50 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com