Hi all,
I need to know, weather some cells of a spreadsheet are merged together or not.
If I define a range and look to isMerged or use getIsMerged, then I get TRUE, even if only the first two cells from ten cells are merged together.
Only if there are no cells at all merged, isMerged will be read FALSE.
Do anyone know about this - and how to work around? I'm using LibreOffice 6.1.4 and Windows7
Best regards,
VBandOoffice
[Solved] How to get range of merged cells
-
- Posts: 33
- Joined: Tue Jul 31, 2018 10:11 am
[Solved] How to get range of merged cells
Last edited by VBandOoffice on Tue Jan 22, 2019 3:46 pm, edited 1 time in total.
LibreOffice 7.5, Windows 10, VB.net 2019, C#
Re: How to get range of merged cells
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
---
Lupp from München
-
- Posts: 33
- Joined: Tue Jul 31, 2018 10:11 am
Re: How to get range of merged cells
Hello Lupp,
with the code from Villeroy (Sub fillMergedAreas(oRange, oRanges)) I only get all StartCells of merged cells correctly, but the range is not matching the real merged range.
If there are some unmerged cells between the merged ranges, I will not detect them.
Some Ideas why? - And how to get the real merged range?
Best regards,
VBandOoffice
with the code from Villeroy (Sub fillMergedAreas(oRange, oRanges)) I only get all StartCells of merged cells correctly, but the range is not matching the real merged range.
If there are some unmerged cells between the merged ranges, I will not detect them.
Some Ideas why? - And how to get the real merged range?
Best regards,
VBandOoffice
LibreOffice 7.5, Windows 10, VB.net 2019, C#
Re: How to get range of merged cells
In the attached file (selectMerged.ods) you find a function that returns the merged region of a start cell.
In fact the macro in that document selects all the regions. The code snippet in the other posting is faster since it does not do that.
In fact the macro in that document selects all the regions. The code snippet in the other posting is faster since it does not do that.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Re: How to get range of merged cells
My oops.
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
-
- Posts: 33
- Joined: Tue Jul 31, 2018 10:11 am
Re: How to get range of merged cells
Hi all,
it works!
Thank you Villeroy!
Best regards to all,
VBandOoffice
it works!
Thank you Villeroy!
Best regards to all,
VBandOoffice
LibreOffice 7.5, Windows 10, VB.net 2019, C#