Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

Remove a cell from a range

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
C#_Programmer - 14 Sep 2007 17:04 GMT
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?
Gary''s Student - 14 Sep 2007 17:54 GMT
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

Signature

Gary''s Student - gsnu200744

> 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.
[quoted text clipped - 5 lines]
>
> Is this possible?
C#_Programmer - 14 Sep 2007 19:20 GMT
Awesome... Thank you....

> Re-Create & Dis-Invite:
> This drops the cell B9 from a range:
[quoted text clipped - 27 lines]
> >
> > Is this possible?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.