Stata creates an Excel spreadsheet with the putexcel command 1: Concepts and framework

For a long time, I always wanted to enter such a Stata command type:

Stata用putexcel命令创建Excel表格1:概念和框架

And get an Excel spreadsheet like this:

Stata用putexcel命令创建Excel表格1:概念和框架

In order to create an Excel spreadsheet like the screenshot above, I wrote an ExcelTable program for my own use.

I think most people like programs like this, but may like different layouts. Or you want to write a file that creates a similar form. I can't predict all the different layouts you might want, so I'm going to write a series of blog posts to show you how to create your own Excel spreadsheet. I will even show you how to create your own version of ExcelTable. Today we will focus on the format of design expressions and cells.

In the Stata 14.2 release, we made some improvements to the putexcel command, so you can upgrade the Stata version so that you can run the following cases. You may remember two blog posts about the putexcel command that Kevin Crow once wrote. The blog posts are Export tables to Excel and Retaining an Excel cell's format when using putexcel. You need to set your version of Stata to 13.1 to run the examples provided in the Kevin blog post. Listing the differences in the putexcel command syntax between versions of Stata 14.2 and later may interfere with us, so I'm going to show you only the syntax of Stata 14.2.

Case 1: Setting the target file

We first set the target file and worksheet for the Excel table.

Stata用putexcel命令创建Excel表格1:概念和框架

Create a target file before running any putexcel command. If you do not specify a different table with the putexcel set command, then all subsequent putexcel commands will be written in the worksheet 1 with the file name Table1.xlsx.

Case 2: Write a simple expression in an Excel table

Below, we will write a simple expression in Table 1.

Stata用putexcel命令创建Excel表格1:概念和框架Stata用putexcel命令创建Excel表格1:概念和框架

Case 3: Specifying text alignment in cells

I can add options to putexcel to design the format of the expression. For example, I can specify the horizontal and vertical alignment of an expression in a cell.

Stata用putexcel命令创建Excel表格1:概念和框架

Stata用putexcel命令创建Excel表格1:概念和框架

Case 4: Bold, italic, underline, and strikethrough of text

I can also use expressions to bold, italicize, underline, and strikethrough lines.

Stata用putexcel命令创建Excel表格1:概念和框架Stata用putexcel命令创建Excel表格1:概念和框架

Case 5: Specify font, font size and color

I can even use the font() option to specify the font, font size and color.

Stata用putexcel命令创建Excel表格1:概念和框架Stata用putexcel命令创建Excel表格1:概念和框架

Case 6: Rotational expression

Sometimes, it's easier to display labels by rotating them in a table. I use the txtrotate() option to rotate the expression.

Stata用putexcel命令创建Excel表格1:概念和框架Stata用putexcel命令创建Excel表格1:概念和框架

Case 7: Specify border position, style, and color

Use the border and shading of the cell to create the overall look of the table, and the border() option to set the border of a single cell.

Stata用putexcel命令创建Excel表格1:概念和框架Stata用putexcel命令创建Excel表格1:概念和框架

Case 8: Filling the specified cells with shading

Use the fpattern option to add shading to a single cell.

Stata用putexcel命令创建Excel表格1:概念和框架

Stata用putexcel命令创建Excel表格1:概念和框架

Case 9: Merging cells

I want to create a title that requires several columns by merging cells.

Stata用putexcel命令创建Excel表格1:概念和框架

Stata用putexcel命令创建Excel表格1:概念和框架

Case 10: Combination options

These formatting options allow you to customize the layout of your tables. For example, you want to create a column header by merging several cells, creating a column header that requires a double border at the bottom of each cell and adding some data to the table.

Stata用putexcel命令创建Excel表格1:概念和框架

Stata用putexcel命令创建Excel表格1:概念和框架

This is an option that can be specified by the putexcel command. You can find a complete list of format options in the putexcel[P] entry in the Stata Programming Reference Manual.

Eyelash Mascara Brush

GREAT SEPARATING: eyelash mascar brushes are necessary and great for separating eyelashes and de-clumping mascara before or after mascara application, good to on-the-go and come in handy daily.
ELASTIC: The head for this disposable eyelash wands is elastic and can be bend slightly according to your need. Easy to use and convenient to carry, perfect for bringing along on trips, to use at weddings, proms, or performances.
HIGH QUALITY, WELL MADE: eyelash mascara brushes applicators are great quality and solid connection between brush and handle, the handle is solid and is washable for muti-uses, it's a no-hassle, stress-free way of using lash wands.
APPLICATIONS: lash mascara brush can apply castor oil on your lashes, spreading eyebrow gels or waxes to applying hair gel at the root for superior root lift on your short hairstyle, brushing over your eyebrow hairs smoothly as well.
QUANTITY AND COLOR DIVERSITY: offer different quantities and colours of these eyelash brushes. You can choose as your demand. It lasts for quite a long time whether in beauty salons or in your personal daily use.

Eyelash Mascara Brushes,Lash Mascara Brush,Lash Mascara Brushes

Shenzhen Nanfang Shishang Cosmetic Utensil Co., Ltd. , https://www.nfbrush.com