View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
KC KC is offline
external usenet poster
 
Posts: 55
Default Help!! Copying/pasting

Maybe

set rng=worksheets("Payrollworksheet").range("a2:a46")
i=0
for each c in rng
worksheets("Payroll").range("a" & 7*i+4)=c
i=i+1
next c

"Matt G" wrote in message
...
Hi,

I want to copy cells from a workbook ,which will vary in name, to another
workbook called "extraction_file". But the paste is uneven.

Source: worksheet = PayrollWorksheet
range = a2 through a46

Destination: worksheet = Payroll
range = a4, a11, a18 etc. increasing by 7 (days of the
week)

So a2 would copy and paste to a4, a3 to a11, a4 to a18, etc.

There are several other cells to copy in the same manner but once I see
the
methodology of the macro I can (hopefully) expand it to encompass the rest
of
the job.

The macro I currently have is absurdly long and cumbersome and I'm hoping
to
streamline it and learn better programming techniques.

Any help is appreciated.