Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 331
Default Filling an array with ranges

Hi,

Im trying to write the first two rows and the last row of a range to a
two-dimensional array Can this be done w/o looping?

Thanks!

Dim FlashArr()
Set wkb = ActiveWorkbook

Set rng = Range(D4)
CellsAcross = Range(rng, rng.End(xlToRight)).Columns.Count

ReDim FlashArr(1 To 3, 1 To CellsAcross)
FlashArr = rng.Resize(2, CellsAcross)
FlashArr = Range(rng.End(xlDown), rng.End(xlDown).End(xlToRight))
--
______
Regards,
Greg
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Filling an array with ranges

Greg wrote:
Hi,

Im trying to write the first two rows and the last row of a range to a
two-dimensional array Can this be done w/o looping?

Thanks!

Dim FlashArr()
Set wkb = ActiveWorkbook

Set rng = Range(D4)
CellsAcross = Range(rng, rng.End(xlToRight)).Columns.Count

ReDim FlashArr(1 To 3, 1 To CellsAcross)
FlashArr = rng.Resize(2, CellsAcross)
FlashArr = Range(rng.End(xlDown), rng.End(xlDown).End(xlToRight))


Sub abtest3()
Dim FlashArr

Set rng = range("D6")
CellsAcross = range(rng, rng.End(xlToRight)).Columns.Count
CellsDown = range(rng, rng.End(xlDown)).Rows.Count
Set rng1 = rng.Resize(2, CellsAcross)
Set rng2 = range(rng(CellsDown, 1), rng(CellsDown, CellsAcross))
rng1.Copy range("J1")
rng2.Copy range("J1").Offset(2)
Set rng3 = range("J1").Resize(3, CellsAcross)
ReDim FlashArr(1 To 3, 1 To CellsAcross)
FlashArr = rng3
End Sub

Alan Beban
Reply
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
help with filling in an array formula Caitlin Excel Discussion (Misc queries) 5 November 7th 06 08:12 PM
Filling an array from one sheet to another fluffypluisje Excel Programming 3 May 24th 06 11:31 AM
Filling an array with a Loop Kevin O'Neill[_2_] Excel Programming 3 January 4th 06 06:40 PM
filling a form with an array JT Excel Programming 1 October 26th 05 04:11 PM
Filling an array with data Dongle Excel Worksheet Functions 2 May 18th 05 06:06 PM


All times are GMT +1. The time now is 03:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"