# Merging and formatting cells in Excel from Julia

**URL:** <https://discourse.julialang.org/t/merging-and-formatting-cells-in-excel-from-julia/18786>\
**Category:** General Usage\
**Tags:** question, package, xlsx\
**Created:** [December 18, 2018, 7:44am UTC](https://discourse.julialang.org/t/merging-and-formatting-cells-in-excel-from-julia/18786 "2018-12-18T07:44:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ahmetumutdurmus](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@ahmetumutdurmus](https://discourse.julialang.org/u/ahmetumutdurmus)\
**Post date:** [December 18, 2018, 7:44am UTC](https://discourse.julialang.org/t/merging-and-formatting-cells-in-excel-from-julia/18786/1 "2018-12-18T07:44:42Z")

</div>

Hello,

Is there a way of merging cells, formatting and aligning cell contents in an Excel file using Julia? Using a package is also fine. I am currently using XLSX.jl to write to Excel files yet for merging, formatting and aligning I would have to explicitly open the Excel file afterwards. I wasn’t sure if XLSX.jl even claimed to provide this functionality so I figured I ought to write this question here.

---

<div class="post-metadata">

**Author:** ![jaakkor2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jaakkor2/32/2540_2.png) [@jaakkor2](https://discourse.julialang.org/u/jaakkor2)\
**Post date:** [December 18, 2018, 7:56am UTC](https://discourse.julialang.org/t/merging-and-formatting-cells-in-excel-from-julia/18786/2 "2018-12-18T07:56:00Z")

</div>

PyCall and openpyxl work fine, something like

```julia
# using Conda; Conda.add("openpyxl")
using PyCall
@pyimport openpyxl
wb = openpyxl.Workbook()
ws = wb[:create_sheet](title="Test1")
ws[:merge_cells]("A1:D3")
wb[:save]("test.xlsx")

```

---

<div class="post-metadata">

**Author:** ![ahmetumutdurmus](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@ahmetumutdurmus](https://discourse.julialang.org/u/ahmetumutdurmus)\
**Post date:** [December 18, 2018, 8:45am UTC](https://discourse.julialang.org/t/merging-and-formatting-cells-in-excel-from-julia/18786/3 "2018-12-18T08:45:09Z")

</div>

Thanks a lot! Works great, has all the functionalities I want.

---

<div class="post-metadata">

**Author:** ![TimG](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@TimG](https://discourse.julialang.org/u/TimG)\
**Post date:** [August 30, 2026, 2:55pm UTC](https://discourse.julialang.org/t/merging-and-formatting-cells-in-excel-from-julia/18786/4 "2026-08-30T14:55:30Z")

</div>

This is now fully supported in XLSX.jl.
