LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Remove cell from range

I am building a range of cells from a selection that meet certian
criteria. I am using union to build up the range. First problem is
that I cant union a range with itself so on the first loop through it
fails. I get around this by always added cell "a1" to the range but
then once I am done I need to remove cell "a1" from the new range. Is
there a simple strait foward way to drop one particular cell from a
range. I dont want to convert to a long string of cell values because
I think at some point I will run up against string lenght limits.

See below. Any help would be appreciated. Thanks.


Set rng = Selection
'include range A1 in newRng to that union will work on first
iteration
Set newRng = Range("a1")

For Each c In rng
If IsNumeric(c.Formula) Then
If CDbl(c.Value) = CDbl(c.Formula) Then
Set newRng = Union(newRng, c)
End If
End If
Next c
 
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
remove blank cell from a range ranswrt Excel Programming 2 August 5th 08 09:03 PM
how to remove old sort range Lou E Excel Discussion (Misc queries) 3 May 29th 08 04:10 PM
Remove borders in range Karen53 Excel Programming 2 April 10th 08 10:26 PM
Remove a cell from a range C#_Programmer[_2_] Excel Programming 2 September 14th 07 07:20 PM
Remove all borders from a range quartz[_2_] Excel Programming 4 September 20th 05 02:16 AM


All times are GMT +1. The time now is 10:17 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"