# Copying Data from one Excel sheet to three different ones

**URL:** https://discourse.julialang.org/t/copying-data-from-one-excel-sheet-to-three-different-ones/89812
**Category:** Data
**Tags:** xlsx
**Created:** [November 5, 2022, 1:57pm UTC](https://discourse.julialang.org/t/copying-data-from-one-excel-sheet-to-three-different-ones/89812 "2022-11-05T13:57:48Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![MeryKay](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/merykay/32/43753_2.png) [@MeryKay](https://discourse.julialang.org/u/MeryKay)
#### Post date: [November 5, 2022, 1:57pm UTC](https://discourse.julialang.org/t/copying-data-from-one-excel-sheet-to-three-different-ones/89812/1 "2022-11-05T13:57:48Z")

</div>

Hallo everybody,

I would like to copy data from one Excel sheet(named origin) which is saved in A1:A3000 to three different excel sheets (named 1, 2 ,3).  
In the end, I want to have the content from A1:A1000 from “origin” in “1”,  
A1001:A2000 from “origin” in “2”,  
and A2001:A3000 from “origin” in “3”.

How can I mange this?

---

<div class="post-metadata">

### Author: ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)
#### Post date: [November 5, 2022, 2:07pm UTC](https://discourse.julialang.org/t/copying-data-from-one-excel-sheet-to-three-different-ones/89812/2 "2022-11-05T14:07:21Z")

</div>

Are you using [GitHub - felipenoris/XLSX.jl: Excel file reader and writer for the Julia language.](https://github.com/felipenoris/XLSX.jl)?

---

<div class="post-metadata">

### Author: ![MeryKay](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/merykay/32/43753_2.png) [@MeryKay](https://discourse.julialang.org/u/MeryKay)
#### Post date: [November 5, 2022, 2:08pm UTC](https://discourse.julialang.org/t/copying-data-from-one-excel-sheet-to-three-different-ones/89812/3 "2022-11-05T14:08:10Z")

</div>

Yes

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [November 5, 2022, 3:07pm UTC](https://discourse.julialang.org/t/copying-data-from-one-excel-sheet-to-three-different-ones/89812/4 "2022-11-05T15:07:39Z")

</div>

I’m not sure I understand correctly what you are trying to do but it sounds to me like it should be covered in the docs:

[https://felipenoris.github.io/XLSX.jl/stable/tutorial/](https://felipenoris.github.io/XLSX.jl/stable/tutorial/)

This covers reading from and writing to files, including editing existing files. If something isn’t working please provide an MWE of your exact issue.

---

<div class="post-metadata">

### Author: ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)
#### Post date: [November 6, 2022, 12:35am UTC](https://discourse.julialang.org/t/copying-data-from-one-excel-sheet-to-three-different-ones/89812/5 "2022-11-06T00:35:13Z")

</div>

Hi, you can try this:

```julia
using XLSX

# CREATE INPUT DATA:
XLSX.openxlsx("origin.xlsx", mode="w") do xf
    sheet = xf[1]
    XLSX.rename!(sheet, "origin")
    sheet["A1", dim=1] = collect(1:3000)
end

# PRODUCE 3 ADDITIONAL SHEETS:
XLSX.openxlsx("origin.xlsx", mode="rw") do xf
    XLSX.addsheet!(xf, "1")
    xf["1"]["A1"] = xf["origin!A1:A1000"]
    XLSX.addsheet!(xf, "2")
    xf["2"]["A1"] = xf["origin!A1001:A2000"]
    XLSX.addsheet!(xf, "3")
    xf["3"]["A1"] = xf["origin!A2001:A3000"]
end

```
