search
HomeTopicsexcelPractical Excel skills sharing: two quick ways to create salary slips

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!

Practical Excel skills sharing: two quick ways to create salary slips

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.

Practical Excel skills sharing: two quick ways to create salary slips

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

Practical Excel skills sharing: two quick ways to create salary slips

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.

Practical Excel skills sharing: two quick ways to create salary slips

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

Practical Excel skills sharing: two quick ways to create salary slips

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

Practical Excel skills sharing: two quick ways to create salary slips

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

Practical Excel skills sharing: two quick ways to create salary slips

You can see the results as shown below.

Practical Excel skills sharing: two quick ways to create salary slips

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

Practical Excel skills sharing: two quick ways to create salary slips

Then select the cell range A2-H20.

Practical Excel skills sharing: two quick ways to create salary slips

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.

Practical Excel skills sharing: two quick ways to create salary slips

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

1Practical Excel skills sharing: two quick ways to create salary slips

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

1Practical Excel skills sharing: two quick ways to create salary slips

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

Practical Excel skills sharing: two quick ways to create salary slips

Enter 1 in cells H2 and I3.

1Practical Excel skills sharing: two quick ways to create salary slips

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.

1Practical Excel skills sharing: two quick ways to create salary slips

You can see the results as shown below.

1Practical Excel skills sharing: two quick ways to create salary slips

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

Practical Excel skills sharing: two quick ways to create salary slips

You can see that the data is selected.

1Practical Excel skills sharing: two quick ways to create salary slips

Right-click and select "Insert".

Practical Excel skills sharing: two quick ways to create salary slips

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

Practical Excel skills sharing: two quick ways to create salary slips

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.

2Practical Excel skills sharing: two quick ways to create salary slips

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".

Practical Excel skills sharing: two quick ways to create salary slips

You can see that all cells are bordered.

2Practical Excel skills sharing: two quick ways to create salary slips

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.

2Practical Excel skills sharing: two quick ways to create salary slips

The final effect is as follows.

2Practical Excel skills sharing: two quick ways to create salary slips

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.

2Practical Excel skills sharing: two quick ways to create salary slips

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

2Practical Excel skills sharing: two quick ways to create salary slips

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

2Practical Excel skills sharing: two quick ways to create salary slips

Click the "Run" button.

2Practical Excel skills sharing: two quick ways to create salary slips

At this point you can see that the table has completed inserting blank rows.

Practical Excel skills sharing: two quick ways to create salary slips

#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 Sub

3Practical Excel skills sharing: two quick ways to create salary slips

The result after clicking the run button is as follows. You can see that

3Practical Excel skills sharing: two quick ways to create salary slips

# 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!

Statement
This article is reproduced at:部落窝教育. If there is any infringement, please contact admin@php.cn delete
MEDIAN formula in Excel - practical examplesMEDIAN formula in Excel - practical examplesApr 11, 2025 pm 12:08 PM

This 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 examplesGoogle Spreadsheet COUNTIF function with formula examplesApr 11, 2025 pm 12:03 PM

Master 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 usersExcel shared workbook: How to share Excel file for multiple usersApr 11, 2025 am 11:58 AM

This 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 fileHow to convert Excel to JPG - save .xls or .xlsx as image fileApr 11, 2025 am 11:31 AM

This 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 formulasExcel names and named ranges: how to define and use in formulasApr 11, 2025 am 11:13 AM

This 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 examplesStandard deviation Excel: functions and formula examplesApr 11, 2025 am 11:01 AM

This 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 waysSquare root in Excel: SQRT function and other waysApr 11, 2025 am 10:34 AM

This 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 SpreadsheetsGoogle Sheets basics: Learn how to work with Google SpreadsheetsApr 11, 2025 am 10:23 AM

Unlock 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

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

mPDF

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

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

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools