How to merge cells in Excel

HanenHanen Member Posts: 281

Hello,

I have a report to export in Excel and I have to merge two cells.
Any one knows how can I do that???
Thanks for your help :thumbsup:
Regards

Hanen TALBI

Answers

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    pcodCell := 'A1:C1';
    autXWorksheet.Range(pcodCell).Cells.Merge;
    
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • HanenHanen Member Posts: 281
    [/code]I'm using the Buffer Excel Table table I'm not workind directly with the report :cry:
    How can I deal with that problem???
    Do you have an idea?
    I'll be greatful for the answer.
    ExcelBuf.NewRow;
    ExcelBuf.AddColumn('No Customer,FALSE,'',TRUE,FALSE,TRUE,'');
    ExcelBuf.AddColumn('Customer Name',FALSE,'',TRUE,FALSE,TRUE,'');
    
    
    Regards

    Hanen TALBI
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    That functionality is not available.
    You'll have to make your hands dirty and add some code to this Excel Buffer table in order to merge cells.

    PS: Why did you marked this topic as [Solved], while it isn't?
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • HanenHanen Member Posts: 281
    Good morning :)
    It works now but I need to center my data is there a way to do that??? :oops:
    Thanks for your help :thumbsup:
    Regards

    Hanen TALBI
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    codCell := 'A1';
    intAlign := -4108;
    autXWorksheet.Range(codCell).HorizontalAlignment := intAlign;
    

    Next time, visit http://msdn.microsoft.com/en-us/library/bb213535.aspx to explore the Excel Object Model.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • HanenHanen Member Posts: 281


    Thanks :thumbsup:

    Regards

    Hanen TALBI
Sign In or Register to comment.