PC Review


Reply
 
 
JingleRock
Guest
Posts: n/a
 
      23rd Sep 2007
I have the following:

Dim vtInput() As Variant
totalrows = ActiveSheet.UsedRange.Rows.Count
vtInput = Range(Cells(1, 1), Cells(totalrows, 2))
Sheets("BB DATA").Select
ActiveSheet.Range(Cells(5, 1), Cells(totalrows, 2)) = vtInput

The above works fine.

Now, if I change the last line to: ActiveSheet.Range(Cells(5, 1),
Cells(totalrows, 1)) = vtInput;
that works fine as well, giving me the first column of my 2-dimension
array.

How can I paste only the second column of my array?

TIA

 
Reply With Quote
 
 
 
 
JingleRock
Guest
Posts: n/a
 
      23rd Sep 2007
CORRECTION:

I am pasting to Row 1.

 
Reply With Quote
 
Alan Beban
Guest
Posts: n/a
 
      23rd Sep 2007
ActiveSheet.Range(Cells(5, 1), Cells(totalrows, 1)) = _
Application.Index(vtInput, 0, 2)

Alan Beban

JingleRock wrote:
> I have the following:
>
> Dim vtInput() As Variant
> totalrows = ActiveSheet.UsedRange.Rows.Count
> vtInput = Range(Cells(1, 1), Cells(totalrows, 2))
> Sheets("BB DATA").Select
> ActiveSheet.Range(Cells(5, 1), Cells(totalrows, 2)) = vtInput
>
> The above works fine.
>
> Now, if I change the last line to: ActiveSheet.Range(Cells(5, 1),
> Cells(totalrows, 1)) = vtInput;
> that works fine as well, giving me the first column of my 2-dimension
> array.
>
> How can I paste only the second column of my array?
>
> TIA
>

 
Reply With Quote
 
Alan Beban
Guest
Posts: n/a
 
      23rd Sep 2007
You're pasting the second column of the array to Row 1 of some range????

Alan Beban

JingleRock wrote:
> CORRECTION:
>
> I am pasting to Row 1.
>

 
Reply With Quote
 
JingleRock
Guest
Posts: n/a
 
      23rd Sep 2007
Alan, Thanks very much -- that is exactly what I was looking for.
Sorry about the confusion re: my CORRECTION. What I was trying to
say was that I was pasting exactly the same number of rows to my Sheet
that are in my Array, but I now see that is not a necessity.
Thanks again for your prompt reply.

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
array query Joel Allen Microsoft Access Queries 1 13th Nov 2009 01:43 AM
MS Access metadata repository generation query, matrix generationquery, table-generation query, array-generation query. Roy Roebuck Microsoft Access Database Table Design 1 20th Dec 2008 07:23 PM
Redimming an array dynamically assigned from range (how to redim first dimension of a 2-D array? /or/ reverse the original array order) Keith R Microsoft Excel Programming 3 13th Nov 2007 04:08 PM
Array within a query? =?Utf-8?B?Um9iZXJ0X0xfUm9zcw==?= Microsoft Access Queries 2 10th Aug 2005 08:34 PM
SQL query from an array in VB.NET SM Lawless via .NET 247 Microsoft VB .NET 4 13th May 2004 02:17 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:37 PM.