In the previous article "Sharing practical Excel skills: Making a smart attendance sheet", we learned about the method of making a smart attendance sheet. Today I will share two of the fastest ways to make salary slips, which can process 2,000 people in 10 seconds. Come and take a look!

First type: Add auxiliary column
The salary table as shown below, the bottle needs Add a header to each person's salary slip, and leave a blank line on the header for cutting.

We first manually enter 1 and 2 in cells H2 and H3.

Then select the H2-H3 cell range, place the mouse on the lower right corner of the H3 cell, and double-click to fill downward. You can see the following results.

Press ctrl c to copy the area, then click on cell H12, press ctrl V to paste, and get the following results.

Select the data area A1-H21 and click the "Sort" button under the "Data" tab.

Click the drop-down button behind "Main Keywords", select "(Column H)" in the drop-down menu, and click OK.

You can see the results as shown below.

Select the A1-G1 cell range and press ctrl C to copy.

Then select the cell range A2-H20.

Press the positioning shortcut key ctrl G, click "Positioning Conditions" in the pop-up dialog box, and then check "Null Value" in the dialog box shown below. Click OK.

At this point you can see that all blank lines are selected.

Press ctrl V to copy. You can see that the table header is copied to every empty line.

Then select column H and click "Clear All" under the "Home" tab.

Enter 1 in cells H2 and I3.

Select the H2-I3 cell range, then place the mouse on the lower right corner of the I3 cell and double-click to fill it.

You can see the results as shown below.

Select the data in column I, press the ctrl G shortcut key, and select "Constant". Click OK.

You can see that the data is selected.

Right-click and select "Insert".

Select "Entire Line" in the pop-up dialog box.

At this point you can see that there is a blank line in front of each header, which can be used for cropping after printing.

If you want to add a border to the table header and name, select the entire table area, click the border drop-down button under the "Home" tab, and select "All" in the drop-down menu frame line".

You can see that all cells are bordered.

If you want the blank rows to have no borders, you can follow the previous method of locating null values. After locating all blank rows, press the ctrl 1 shortcut key to pop up the setting unit. Format dialog box. In the dialog box, click on the left, middle, and right lines in sequence to remove the three lines on the blank row, and click OK.

The final effect is as follows.

The above method is more suitable for companies with a small number of people. If your company has two or three thousand people, then use the universal template given to you by the bottle below!
Second type: VBA
We will use two pieces of code to insert a trim row (blank row) before each row of employee salary data ), two-step operation to insert table header.
Press the ALT F11 shortcut key to pop up the VBA debugging window as shown below.

After clicking "Insert"-"Template", the page will look like this.

Enter the code in the blank: (note that all punctuation marks in the code are English punctuation marks)
Sub 选定范围隔行插入一行()
Dim i As Integer
For i = 11 To 3 Step -1
Rows(i & ":" & i).Insert
Next
End Sub
Click the "Run" button.

At this point you can see that the table has completed inserting blank rows.
#There are many words in the code that everyone does not know, but in fact, everyone only needs to understand the meaning of the following two rows.
For i = 11 To 3 Step -1
Rows(i & ":" & i).Insert
The meaning of the above code is: starting from line 11, insert a blank line upwards (the difference between the first i and the second i after Rows is 0. If you want to insert two blank lines, you can change the second one to i 1), then insert a blank row every other row (step -1) until row 3 (TO 3).
Next we will delete the original code and enter another set of codes: (note that all punctuation marks in the code are English punctuation marks)
Sub 隔2行插入表头()
For i = 20 To 4 Step -2
Range("A1:G1").Copy
Cells(I,1).Insert
Next
End SubThe result after clicking the run button is as follows. You can see that
# has a similar meaning to the above. We only need to understand the middle two lines.
For i = 20 To 4 Step -2
Range("A1:G1").Copy
cells(I,1).Insert
The meaning of the above code is: from cell A20 (cells(I,1), I is the number of rows, 1 is the number of columns, I is equal to 20 When, it is row 20, column 1 (i.e. cell A20) and start to insert (Insert) a table header that is copied (Copy) from the specified position (A1:G1), and then insert every 2 rows (step -2) 1 header, inserted until row 4 (To 4). If it is a two-line header, you only need to change A1:G1 to the corresponding header area.
Related learning recommendations: excel tutorial
The above is the detailed content of Practical Excel skills sharing: two quick ways to create salary slips. For more information, please follow other related articles on the PHP Chinese website!
MEDIAN formula in Excel - practical examplesApr 11, 2025 pm 12:08 PMThis tutorial explains how to calculate the median of numerical data in Excel using the MEDIAN function. The median, a key measure of central tendency, identifies the middle value in a dataset, offering a more robust representation of central tenden
Google Spreadsheet COUNTIF function with formula examplesApr 11, 2025 pm 12:03 PMMaster Google Sheets COUNTIF: A Comprehensive Guide This guide explores the versatile COUNTIF function in Google Sheets, demonstrating its applications beyond simple cell counting. We'll cover various scenarios, from exact and partial matches to han
Excel shared workbook: How to share Excel file for multiple usersApr 11, 2025 am 11:58 AMThis tutorial provides a comprehensive guide to sharing Excel workbooks, covering various methods, access control, and conflict resolution. Modern Excel versions (2010, 2013, 2016, and later) simplify collaborative editing, eliminating the need to m
How to convert Excel to JPG - save .xls or .xlsx as image fileApr 11, 2025 am 11:31 AMThis tutorial explores various methods for converting .xls files to .jpg images, encompassing both built-in Windows tools and free online converters. Need to create a presentation, share spreadsheet data securely, or design a document? Converting yo
Excel names and named ranges: how to define and use in formulasApr 11, 2025 am 11:13 AMThis tutorial clarifies the function of Excel names and demonstrates how to define names for cells, ranges, constants, or formulas. It also covers editing, filtering, and deleting defined names. Excel names, while incredibly useful, are often overlo
Standard deviation Excel: functions and formula examplesApr 11, 2025 am 11:01 AMThis tutorial clarifies the distinction between standard deviation and standard error of the mean, guiding you on the optimal Excel functions for standard deviation calculations. In descriptive statistics, the mean and standard deviation are intrinsi
Square root in Excel: SQRT function and other waysApr 11, 2025 am 10:34 AMThis Excel tutorial demonstrates how to calculate square roots and nth roots. Finding the square root is a common mathematical operation, and Excel offers several methods. Methods for Calculating Square Roots in Excel: Using the SQRT Function: The
Google Sheets basics: Learn how to work with Google SpreadsheetsApr 11, 2025 am 10:23 AMUnlock the Power of Google Sheets: A Beginner's Guide This tutorial introduces the fundamentals of Google Sheets, a powerful and versatile alternative to MS Excel. Learn how to effortlessly manage spreadsheets, leverage key features, and collaborate


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Dreamweaver Mac version
Visual web development tools






