Two Methods for batch deletion of hyperlinks in Word and Excel

Source: Internet
Author: User

When a column of cells in Excel contains hyperlinks, you must manually delete them one by one: Right-click any cell in the column that contains hyperlinks and select "cancel HYPERLINK" (figure 1 ). Because of the large quantity, you can only consider using the batch Delete method. .

I. macrosCodeRemoval Method

Open the Excel file, switch to the "View" tab, and click "macro"> "Recording macro". In the "Recording new macro" window, define a macro name: removehyperlinks, click "OK" to exit;

Click "macro"> "view macro", select "removehyperlinks" under "macro name", and click "edit" to open the "Microsoft Visual Basic" editor, replace all the code in the right window with the following content (figure 3), and save and close the VBA Editor :.

Sub removehyperlinks ()
'Remove all hyperlinks from the active Sheet

Activesheet. hyperlinks. Delete

End sub

Click "macro"> "view macro", select "removehyperlinks" under "macro name", and click "execute" to remove the worksheet link.

You can use the following code to achieve the same purpose :.

Sub zaphyperlinks ()

Cells. hyperlinks. Delete

End sub.

Delete all hyperlinks in Word
: Open the word menu tool-> macro-> Visual Basic Editor, or press the shortcut key Alt + F11 to open the Visual Basic Editor and select menu insert-> module in the Visual Basic Editor, then, a module 1 compiling window appears, and paste the following code.

Sub hyperlinksdel ()
Dim I %
Application. screenupdating = false
With thisdocument. Hyperlinks
For I =. Count to 1 step-1
. Item (I). Delete
Next
End
Application. screenupdating = true
End sub

Close the Visual Basic Editor and return to the word. Select the word menu tool> macro to open the macro dialog box. You will find that a macro named hyperlinksdel is added, and select this macro, click the "run" button to delete all the superlinks in the wrod document.

Ii. Selective pasting

Right-click the column containing the hyperlink and select "copy". Then insert a blank column to the right of the column (left), right-click the blank column, and select "select Paste ".

in the "selective paste" window that appears later, click the "value" option (when selecting "value" and other options, the "paste link" button becomes unavailable in gray, and the hyperlink will not be pasted.) At last, keep the column and then delete the column that originally contained the hyperlink.

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.