# Copying data from one spreadsheet to another

#### kellyhilde

##### New Member
Okay, I have data for 400 employees in one spreadsheet. I am trying to move 4 fields of data to a second spreadsheet. But I have 11 rows for each employee in the 2nd spreadsheet.

How do I copy my formula so that it is the same for the first 11 rows and then moves down a row for the 12 row?

ie)
=A1
=A1
=A1
=A1
=A1
=A1
=A1
=A1
=A1
=A2
etc

### Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
Looking at my example, I realize I forgot some vital information.

The first row will have all 4 fields of data, but row 2-11 will only have one piece of data.

How do I copy my formula so that it is the same for the first 11 rows and then moves down a row for the 12 row?

ie)
=A1, =A2, =A3, =A4
=A1
=A1
=A1
=A1
=A1
=A1
=A1
=A1
=B1, =B2, =B3, =B4
=B1
etc
<!-- / message -->

With your basic data in sheet1 starting "A2", this code will place you formulas in sheet2 starting "A2.

Code:
``````[COLOR="Navy"]Sub[/COLOR] MG21Oct03
[COLOR="Navy"]Dim[/COLOR] Rng     [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] Dn      [COLOR="Navy"]As[/COLOR] Range
[COLOR="Navy"]Dim[/COLOR] c       [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Long[/COLOR]
[COLOR="Navy"]Dim[/COLOR] col     [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]Integer[/COLOR]
[COLOR="Navy"]Dim[/COLOR] oFrm    [COLOR="Navy"]As[/COLOR] [COLOR="Navy"]String[/COLOR]
c = 2
[COLOR="Navy"]With[/COLOR] Sheets("Sheet1")
[COLOR="Navy"]Set[/COLOR] Rng = .Range(.Range("A2"), .Range("A" & Rows.Count).End(xlUp))
[COLOR="Navy"]For[/COLOR] [COLOR="Navy"]Each[/COLOR] Dn [COLOR="Navy"]In[/COLOR] Rng
Sheets("Sheet2").Range("A" & c).Resize(, 4).Formula = "=" & .Name & "!" & Dn.Address & " : " & Dn.Offset(, 3).Address & ""
Sheets("Sheet2").Range("A" & c + 1).Resize(10).Formula = "=" & .Name & "!" & Dn.Address & ""
c = c + 11
[COLOR="Navy"]Next[/COLOR] Dn
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]With[/COLOR]
[COLOR="Navy"]End[/COLOR] [COLOR="Navy"]Sub[/COLOR]``````
Regards Mick

Replies
0
Views
258
Replies
3
Views
191
Replies
1
Views
62
Replies
3
Views
176
Replies
1
Views
203

1,207,392
Messages
6,078,223
Members
446,323
Latest member
fishezuk

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back