MATLAB Answers

How can I adress merged cells in excel sheet?

7 views (last 30 days)
Denny Milakara
Denny Milakara on 2 Oct 2020
For example: cells A1:D1 are merged und contain the string 'test'. How can I correctly adress these cells to get the string?
I tried by adressing the first cell of merged cells but read out the first letter only.


Sign in to comment.

Answers (1)

Kiran Felix Robert
Kiran Felix Robert on 8 Oct 2020
Hi Denny,
You can use the readcell function to readout the cell.
The following is an example, assuming you have merged cells A1 to D1 you can specify the range as,
M = readcell('Book1.xlsx','Range','A1:D1');
This will readout 4 cells with M(1) containing the required text
M = readcell('Book1.xlsx','Range','A1:A1');
This will readout the merged cells with M containing the required text
Kiran Felix Robert


Sign in to comment.



Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!