Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ARRAY QUERY
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
ARRAY QUERY
CORRECTION:
I am pasting to Row 1. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
ARRAY QUERY
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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
ARRAY QUERY
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. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
ARRAY QUERY
Alan, Thanks very much -- that is exactly what I was looking for.
Sorry about the confusion 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to import web query as array? | Excel Discussion (Misc queries) | |||
Array data in SQL Query? | Excel Programming | |||
SQL Query Destination as an array varable | Excel Programming | |||
Web Query & Array Questions! | Excel Programming | |||
Query for data in an array | Excel Programming |