WPS table quickly hides unused area methods

Source: Internet
Author: User
Tags first row

In automated office, if you want to display only a specified portion of the WPS table, and the remainder is set to hidden, you need to use row and column hide commands more than once. As an Office whiz, you can use VBA code to hide all areas of a selected contiguous area at once.

The first step is to make a document.

Open WPS Form 2009 (online document public beta), create a new blank document, and enter numbers in some areas as a usage area.

Second, click the "Tools"-"Macros"-"create" new macros.

In the third step, enter or copy the following code in Microsoft Visual Basic.

Sub Hiddensurroundrange ()

Dim Celfirst as range, cellast as range

If not Selection are nothing Then

With Selection

' first cell in the currently selected range

Set Celfirst =. Cells (1)

' The last cell in the currently selected range

Set cellast =. Cells (. Cells.count)

End With

If celfirst.address <> "$A $" Then

' Blue Area

With Range ([A1], Celfirst.offset (iif (celfirst.row = 1, 0,-1), IIF (celfirst.column = 1, 0,-1))

' If the current selection does not include the first row, hide the line that contains the blue area

If celfirst.row <> 1 Then. Entirerow.hidden = True

' If the current selection does not include the first column, hide the column that contains the blue area

If celfirst.column <> 1 Then. Entirecolumn.hidden = True

End With

End If

If cellast.address <> "$IV $65536" Then

' A green area similar to the above treatment

With Range (Cellast.offset (iif (cellast.row = 65536, 0, 1), IIF (Cellast.column = 256, 0, 1)),

[IV65536])

If cellast.row <> 65536 Then. Entirerow.hidden = True

If cellast.column <> 256 Then. Entirecolumn.hidden = True

End With

End If

End If

End Sub

Step Fourth, execute the View-tools-Control Toolbox, click button, select the appropriate location to insert a floating "hide" button, and specify a Hiddensurroundrange macro for it.

The fifth step, select the Use area, click the "Hide" button, use the area outside the area for a one-time all hidden.

Tip: WPS default installation does not have a VBA environment, you can not use the macro function, to implement the features described in the tutorial, you need to install VBA,WPS Office Online Document public beta can share documents, as long as there is a mailbox, you can share the VBA documents, eliminating the search, download the pain. Also, because macros are used in the instance, macros are enabled when you open the file.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.