Copying Data from one Excel sheet to three different ones

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?

Are you using GitHub - felipenoris/XLSX.jl: Excel file reader and writer for the Julia language.?

Yes

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/

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.

Hi, you can try this:

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