LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default A range variable consisting of multiple ranges.

When you introduce deleting a column, you open a whole new can of worms.

set rng = Range("A:A,Q:Q")
? rng.Address
$A:$A,$Q:$Q
? columns(2).Delete
True
? rng.Address
$A:$A,$P:$P
columns(1).Delete
? rng.Address
$O:$O

Test out some of your ideas in the immediate window and perhaps you will
find a solution.

--
Regards,
Tom Ogilvy


wrote in message
ups.com...
Thanks Tom,

Insightful lesson!
If I understand you correctly, relative references on a union of ranges
will not work if the position these ranges (in relative to each other)
changes.

E.g. if column B to P are deleted, the two ranges become

"A1:A10" and "B5,B23"

and the reference identification, or offset will refer to a wrong cell,
or in this example, invalid.

If this is so and there is no way around it, I will have to change my
approach and not using union.

Thanks,
pac



 
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
Range matching multiple named Ranges ben simpson Excel Discussion (Misc queries) 0 March 15th 06 06:45 PM
Countif & ranges consisting of multiple areas Jurry Excel Worksheet Functions 2 November 15th 04 03:24 PM
Countif & ranges consisting of multiple areas Jurry Excel Worksheet Functions 0 November 15th 04 12:39 PM
Countif & ranges consisting of multiple areas Jurry Excel Worksheet Functions 1 November 15th 04 12:25 PM
Countif & ranges consisting of multiple areas Jurry Excel Worksheet Functions 1 November 15th 04 09:03 AM


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