LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default variant array containing cel adresses convert to actual ranges-array

I suspect that CelAdresses(LBound(CelAdresses)), i.e., the first
element of CelAdresses, does not contain a valid address. What is in
it when you get the error?

--
Regards,

Tushar Mehta, MS MVP -- Excel
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Thanks Tom for your quick reply.

It made perfect sence. However after implementing it into my code it got
this error:

Run-time error '1004':



Method 'Range' of object '_Global' failed


On this line:

Set rng = Range(CelAdresses(LBound(CelAdresses)))

Maybe you could tell me some solutions for this problem.

Again, thanks for what you've already done.

Peter

"Tom Ogilvy" schreef in bericht
...
Dim rng as Range
set rng = Range(celadresses(lbound(celadresses)))
for i = lbound(celadresses)+1 to ubound(celadresses)
set rng = union(range(celadresses(i)),rng)
Next
rng.Select

--
Regards,
Tom Ogilvy

"Peter" wrote in message
...
Hi everyone,

In the macro I've already produced so far, which works except for this

here
little part, a variant array is filled with absolute cell adresses. When

the
macro is finished doing the bulk of the work, a range needs to be

selected
consisting of all the cells gathered in the CellAdresses array.

This doesn't work: Range(CelAdresses).Select, obviously (I tried it

anyway,
just to see what I already knew), because the array is Dimmed as a

variant.
Switching the Dim statement to make it into a range array also causes a
runtime error.

How can I use the CellAdresses array with its contents to get the

selection
of separate cells I want?
Does the array need to be converted into a range array, if yes, How ?

Regards,
Peter









 
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
Array formula: how to join 2 ranges together to form one array? Rich_84 Excel Worksheet Functions 2 April 1st 09 06:38 PM
Use named ranges in array formula Jan Excel Worksheet Functions 14 February 26th 07 08:11 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Array of page ranges mik[_3_] Excel Programming 4 November 26th 03 02:40 PM
[excel 97 vba ] Reading ranges into an array steve Excel Programming 1 October 30th 03 02:10 PM


All times are GMT +1. The time now is 08:50 AM.

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"