Remember an Excel operation against the sky (picture deletion, hyperlink extraction)

    When sorting out the data some time ago, don’t be too worried➳♥゛, the specific process is as follows: the data copied from the Internet is saved in an excel sheet, and it turns out that it is even saved with the pictures, not only that, because it needs to be extracted The URL address of the hyperlink, as a programmer, can't do some anti-sky operations, how can it be done? Do you want to be stupid and do hard work? So I have to do some research. Below are some of the experiences I have summarized. It is convenient to use and saves time. It is the first choice for home travel, hehe.

   (1) Unified deletion of pictures

    When there are too many pictures in your excel sheet, and you don't want to delete them manually one by one, all you need is to move your fingers (don't you mind? Haha), isn't it super easy. Specific operations:

    (1) Open the form (well, what did you say if you didn't open it)

    (2) Press Fn+F5 or Ctrl+F5 (different personal computers, the key combination may be different, you can try more), the following pop-up box appears, which means success:

    (3) Click the positioning condition, select the object in it, and confirm, you will see that the pictures in the table are all selected:

    (4) Finally, of course, is the delete operation, click the Delete key on the keyboard to easily get it.

   (2) Hyperlink URL extraction

    From the above table, we can see that there are many hyperlinks. What is our goal - extracting the URL, so the question is, how to extract this quickly and conveniently? Here is a tool-macro, we have to write a VBA function, yes, if your excel sheet does not support it, then I can only say - quickly remove it, what is the use of leaving it. Specific operations:

    (1) Open the form

    (2) Right-click the Sheet below the table, and select View Code in the pop-up options (the operation may be different for each person), as follows:

    (3) After choosing to view the code, the VBA project interface will pop up:

    (4) Select your current excel object (if you have multiple sheets open), right-click and select Insert-Module, and enter the code for the extraction function:

    The GetActAddress() function above is the specific implementation of extracting the URL of the hyperlink. The code is as follows:

Function GetActAddress(HlinkCell)

Application.Volatile True
With HlinkCell.Hyperlinks(1)

   GetActAddress = IIf(.Address = "", .SubAddress, .Address)
   
   End With
   
End Function

    (5) Close the VBA project interface, enter =GetActAddress(A2) in the blank cell of the row corresponding to the hyperlink, and you can see that the function you just wrote appears in your table function options, and the parameter A2 corresponds to the hyperlink The location of the cell (count it by yourself), after confirming, you will get the URL of the current hyperlink, you only need to place the mouse in the lower right corner of the cell, etc. into a cross, drag it down, and other hyperlinks The corresponding URL will also be obtained accordingly.

    (6) Do you think this is the end? too naive. The URL obtained by the above operation is obtained through the function and cannot be applied directly, otherwise the word #VALUE will appear instead of the value you need. At this time, just select the column - copy and paste it into another blank column (note that : choose to paste only values ​​when pasting), and you're done.

   (3) Remove hyperlinks and retain text

    When we obtain the URL of the hyperlink, the hyperlink has no value. At this time, do you really want to turn them into plain text format? Simple. Specific operations:

    (1) Select the hyperlink or the column where the hyperlink is located

    (2) Right-click and select the pop-up "Delete Hyperlink"

    (3) After confirmation, you can get the plain text format.

    Well, some of the above small operations are still very practical. After all, in addition to writing code, we will still encounter various things that need to be solved by us. Time is money, and it is very good to master a skill.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324380773&siteId=291194637
sky