View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.office.developer.vba
cheeser83 cheeser83 is offline
external usenet poster
 
Posts: 13
Default Copy entire columns starting from a certain cell down

Thank you for the code. I am trying to decipher it as best I can. I
have a medium understanding of VBA. What part of the code is telling
it where to paste? I would like to be able to change it to paste in a
different area. For example, what it copies our of column A on sheet
1, I want to paste it to column B starting in row 7.

Thank you very much for your help.


Tom Ogilvy wrote:
This copies columns A, G, I , V


Dim v as Variant, col as Long
v = Array(0,6,8,21) ' A, G, I, V
col = 1
set rng = Range(Cells(7,1),Cells(rows.count,1).End(xlup))
for i = lbound(v) to ubound(v)
rng.offset(,v(i)).copy Destination:= _
worksheets("sheet2").Cells(1,col)
col = col + 1
Next


--
Regards,
Tom Ogilvy



"cheeser83" wrote:

I need a code that will copy an entire column, such as column A, but
not starting in cell A1. I would like to copy all cells beginning in
A7 down to the last cell used in column A and then I will paste to a
different sheet. I will be doing this with several different columns,
not just column A, but all columns will start and end in the same rows,
but the number of rows used will vary from month to month. I may have
10 rows one month, but 1000 the next.

Any help is much appreciated!