sheet.add_row['Heading', '', 'Value']
sheet.add_row['value1', 'value2', 'value3']
Say I have the above 2 lines of code to write data to a spreadsheet using axlsx gem. There are 3 columns for which I have added data as shown above. However I would like to merge row1:col1 and row1:col2 ('Heading' and '').
I have used this code and this works:
sheet.merge_cells "A1:B1"
However, I would like to merge the 2 cells in the current row dynamically without having to hardcode the cell positions like A1 & B1.
How can I achieve this?