ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   array (https://www.excelbanter.com/excel-programming/404126-array.html)

internetisnice

array
 
i have this code for setting an arayy from a range

Set r = Range(ActiveCell, ActiveCell.SpecialCells(xlLastCell))
t = r.Value

this is fast for not using "for next" or "do while"
but as i need only some parts of the range (for example columns A C F G) how
can i do that?
is it possible?



Dave Peterson

array
 
You can either pick up all the cells in that range and ignore them when you
process stuff.

Or you can build your array by looping through the cells in the order that you
want.

internetisnice wrote:

i have this code for setting an arayy from a range

Set r = Range(ActiveCell, ActiveCell.SpecialCells(xlLastCell))
t = r.Value

this is fast for not using "for next" or "do while"
but as i need only some parts of the range (for example columns A C F G) how
can i do that?
is it possible?


--

Dave Peterson

JLGWhiz

array
 
You can probably use the Union function.

Set CombRng = Application.Unition(Range("A:A"), Range("C:C") _
Range("F:F"), Range("G:G")

Check it out in VBA Help.

"internetisnice" wrote:

i have this code for setting an arayy from a range

Set r = Range(ActiveCell, ActiveCell.SpecialCells(xlLastCell))
t = r.Value

this is fast for not using "for next" or "do while"
but as i need only some parts of the range (for example columns A C F G) how
can i do that?
is it possible?




internetisnice

array
 
thanks!






"JLGWhiz" ha scritto nel messaggio
...
You can probably use the Union function.

Set CombRng = Application.Unition(Range("A:A"), Range("C:C") _
Range("F:F"), Range("G:G")

Check it out in VBA Help.

"internetisnice" wrote:

i have this code for setting an arayy from a range

Set r = Range(ActiveCell, ActiveCell.SpecialCells(xlLastCell))
t = r.Value

this is fast for not using "for next" or "do while"
but as i need only some parts of the range (for example columns A C F G)
how
can i do that?
is it possible?







All times are GMT +1. The time now is 05:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com