Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python Excel merge cell

import xlsxwriter

# Create an new Excel file and add a worksheet.
workbook = xlsxwriter.Workbook('merge1.xlsx')
worksheet = workbook.add_worksheet()

# Create a format to use in the merged range.
merge_format = workbook.add_format({
    'bold': 1,
    'border': 1,
    'align': 'center',
    'valign': 'vcenter',
    'fg_color': 'yellow'})

# Test to add in merged cell
text = "This is a merged cell!"
# Merge 3 cells.
worksheet.merge_range('B4:D4', text, merge_format)

# Merge 3 cells over two rows.
worksheet.merge_range('B7:D8', text, merge_format)
# Will save on file
workbook.close()
Comment

PREVIOUS NEXT
Code Example
Python :: how to install python 3.6.0 on debian 
Python :: if else python 
Python :: Clear All the Chat in Discord Channel With Bot Python COde 
Python :: pyplot width 
Python :: django drop all tables 
Python :: boto3 delete bucket object 
Python :: string remove everything after character python 
Python :: split data train python 
Python :: get mode dataframe 
Python :: python install jedi 
Python :: lexicographic order python 
Python :: how to start an exe file in python 
Python :: how to make table using python 
Python :: scroll down selenium python 
Python :: how to get images on flask page 
Python :: python random list 
Python :: Export a Pandas dataframe as a table image 
Python :: changing plot background color in python 
Python :: django models.py convert DateTimeField to DateField 
Python :: list to dataframe 
Python :: how to convert utf-16 file to utf-8 in python 
Python :: python define random variables name 
Python :: inverse list python 
Python :: import qq plot 
Python :: matplotlib increase tick frequency 
Python :: change xlabel rotate in seaborn 
Python :: print variable name 
Python :: python code to print prime numbers 
Python :: requests.packages.urllib3.util.retry could not be resolved from source 
Python :: how to make a list using lambda function in python 
ADD CONTENT
Topic
Content
Source link
Name
1+1 =