Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Fill a Range with VB SafeArray

Is there a fast way to fill a range of cells with the contents
of a VB SafeArray. I need a shortcut to the following
code :

For i = 0 To UBound(c)
Sheets(sSheet).Cells(i + 2, 6).Value = A(i)
Next i

Also, is there a fast way to fill VB SafeArray with the
contents of a Range. Again, I need a shortcut to the
following code :

ReDim FVE(0 To cds.cbData)
For i = 0 To cds.cbData
FVE(i) = Sheets(sSheet).Cells(i + 2, 20).Value
Next i

Please help and TIA, Robert


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Fill a Range with VB SafeArray

Hi Rob,

What is wrong with the loop? It's fast, what more do you need?

The latter can be done with

ReDim FVE(0 To cds.cbData)
FVE = Sheets(sSheet).Cells(2, 20).Resize(cds.cbData+1)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob" wrote in message
...
Is there a fast way to fill a range of cells with the contents
of a VB SafeArray. I need a shortcut to the following
code :

For i = 0 To UBound(c)
Sheets(sSheet).Cells(i + 2, 6).Value = A(i)
Next i

Also, is there a fast way to fill VB SafeArray with the
contents of a Range. Again, I need a shortcut to the
following code :

ReDim FVE(0 To cds.cbData)
For i = 0 To cds.cbData
FVE(i) = Sheets(sSheet).Cells(i + 2, 20).Value
Next i

Please help and TIA, Robert




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Fill a Range with VB SafeArray

Nothing, I was hoping for something more concise. And you gave me what I
asked for. Thank you

"Bob Phillips" wrote in message
...
Hi Rob,

What is wrong with the loop? It's fast, what more do you need?

The latter can be done with

ReDim FVE(0 To cds.cbData)
FVE = Sheets(sSheet).Cells(2, 20).Resize(cds.cbData+1)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob" wrote in message
...
Is there a fast way to fill a range of cells with the contents
of a VB SafeArray. I need a shortcut to the following
code :

For i = 0 To UBound(c)
Sheets(sSheet).Cells(i + 2, 6).Value = A(i)
Next i

Also, is there a fast way to fill VB SafeArray with the
contents of a Range. Again, I need a shortcut to the
following code :

ReDim FVE(0 To cds.cbData)
For i = 0 To cds.cbData
FVE(i) = Sheets(sSheet).Cells(i + 2, 20).Value
Next i

Please help and TIA, Robert






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Fill a Range with VB SafeArray

Sorry I couldn't provide one for the former.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob" wrote in message
...
Nothing, I was hoping for something more concise. And you gave me what I
asked for. Thank you

"Bob Phillips" wrote in message
...
Hi Rob,

What is wrong with the loop? It's fast, what more do you need?

The latter can be done with

ReDim FVE(0 To cds.cbData)
FVE = Sheets(sSheet).Cells(2, 20).Resize(cds.cbData+1)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Rob" wrote in message
...
Is there a fast way to fill a range of cells with the contents
of a VB SafeArray. I need a shortcut to the following
code :

For i = 0 To UBound(c)
Sheets(sSheet).Cells(i + 2, 6).Value = A(i)
Next i

Also, is there a fast way to fill VB SafeArray with the
contents of a Range. Again, I need a shortcut to the
following code :

ReDim FVE(0 To cds.cbData)
For i = 0 To cds.cbData
FVE(i) = Sheets(sSheet).Cells(i + 2, 20).Value
Next i

Please help and TIA, Robert








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
SumIf - when I fill down the Range, Criteria & sum range changes markholt Excel Worksheet Functions 3 October 28th 08 12:37 AM
Fill Range With A Value Derek Hart Excel Worksheet Functions 1 December 24th 07 12:55 AM
How to fill a range with data from another range? Themis Excel Discussion (Misc queries) 4 September 15th 05 07:29 PM
Fill down range Nancy[_4_] Excel Programming 2 December 17th 03 04:39 PM
ComboBox List Fill Range Dan Excel Programming 3 December 3rd 03 04:56 PM


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