Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

ARRAY QUERY

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JingleRock - 23 Sep 2007 10:08 GMT
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
JingleRock - 23 Sep 2007 10:16 GMT
CORRECTION:

I am pasting to Row 1.
Alan Beban - 23 Sep 2007 10:37 GMT
You're pasting the second column of the array to Row 1 of some range????

Alan Beban

> CORRECTION:
>
> I am pasting to Row 1.
Alan Beban - 23 Sep 2007 10:20 GMT
ActiveSheet.Range(Cells(5, 1), Cells(totalrows, 1)) = _
Application.Index(vtInput, 0, 2)

Alan Beban

> I have the following:
>
[quoted text clipped - 14 lines]
>
> TIA
JingleRock - 23 Sep 2007 16:42 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.