Macro or the fastest way to auotfile rows

K

klafert

I need a macros to autofill rows. I am working on one now but have a few
problems. I have one spreadsheet that has a row for each employee for each
payperiod. It has the employee name, check number, date, hours worked,
vacation sick, pay etc, earnings. The hours worked may be in 3 column
depending on if it is regular pay, overtime 1 pay, overtime 2 pay, and
commission - (which is an amont). I take that line and copy it in another
spreadsheet for 27 rows for one employee and one pay period. Then the I copy
the 2nd row which is another another employee and one pay period, etc etc. I
would like to design a macros so copy all the rows for a certain range, (say
column a1..j1). I have other data in columns k1..ac that will not get copy.
I am using an Index to pull that info, that is not a problem. I just need 27
rows for 1 row of data from the originaly spreadsheet.
 
E

excelent

change sheet name in range lines to urs:

Sub CopyRow()
Dim t
Sheets("ur source sheet-name").Select
For t = 1 To 28
Range("A" & t & ":J" & t).Copy Destination:=Sheets("ur destinations
sheet").Cells(t, 1)
Next
End Sub



"klafert" skrev:
 
T

Tom Ogilvy

Sub Copy1To27()
Dim rng as Range, cell as Range
With worksheets(1)
set rng = .Range(.cells(2,1),.Cells(2,1).End(xldown))
End with
for each cell in rng
cell.Resize(1,10).Copy Destination:= _
worksheets(2).Cells(rows.count,1).End(xlup)(2).Resize(27,10)
Next
End Sub
 
D

Dave Peterson

Check your other post(s), too.
I need a macros to autofill rows. I am working on one now but have a few
problems. I have one spreadsheet that has a row for each employee for each
payperiod. It has the employee name, check number, date, hours worked,
vacation sick, pay etc, earnings. The hours worked may be in 3 column
depending on if it is regular pay, overtime 1 pay, overtime 2 pay, and
commission - (which is an amont). I take that line and copy it in another
spreadsheet for 27 rows for one employee and one pay period. Then the I copy
the 2nd row which is another another employee and one pay period, etc etc. I
would like to design a macros so copy all the rows for a certain range, (say
column a1..j1). I have other data in columns k1..ac that will not get copy.
I am using an Index to pull that info, that is not a problem. I just need 27
rows for 1 row of data from the originaly spreadsheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top