Good afternoon,
I’m creating an Excel file and need to span multiple columns. How can I
do this?
Example: I want the Excel sheet to look like this
1 | 2 | 3 | 4
A | two columns wide | Hi
Thanks,
Joe
Good afternoon,
I’m creating an Excel file and need to span multiple columns. How can I
do this?
Example: I want the Excel sheet to look like this
1 | 2 | 3 | 4
A | two columns wide | Hi
Thanks,
Joe
On 22 October 2010 21:11, Joe P. [email protected] wrote:
Good afternoon,
I’m creating an Excel file and need to span multiple columns. How can I
do this?Example: I want the Excel sheet to look like this
1 | 2 | 3 | 4
A | two columns wide | Hi
I think you may have sent this to the wrong list, this is for Ruby on
Rails issues.
(If I remember correctly you mark the cells and right click and there
is an option for spanning there).
Colin
I think you may have sent this to the wrong list, this is for Ruby on
Rails issues.(If I remember correctly you mark the cells and right click and there
is an option for spanning there).Colin
Sorry, I meant to add that I’m doing this programmatically with the
Spreadsheet gem. I’m trying to get it to generate a spreadsheet with
some cells spanning multiple columns.
Thanks for the reply, though, and sorry for not being clear
If you are running on Windows when creating your Excel file, the
following code will do what you’re looking for.
require ‘win32ole’
excel = WIN32OLE.connect(‘Excel.Application’) rescue excel =
WIN32OLE.new(‘Excel.Application’)
book = excel.workbooks.add
sheet = book.worksheets(1)
sheet.Cells(1, 1).value = “text to go into merged cells”
sheet.Range(“A1:C1”).Merge
excel.visible = true
Unfortunately, I don’t have any experience with the spreadsheet gem.
When generating excel spreadsheets, I use the win32ole gem.
Hope this helps…
Bob
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs