Data analysis----The use of VBA

Source: Internet
Author: User

1.VBA Common Small Code 001 One-click to create a worksheet directory with hyperlinks

Sub ml ()    Dim sht as Worksheet, I&, shtname$    Columns (1). ClearContents   ' empty column A data    cells (1, 1) = "Directory"   ' first cell write String ' directory '    i = 1   ' Set the initial value of I to 1.       for every sht in worksheets ' loop, each sheet of the current workbook        shtname = sht. Name if        shtname <> activesheet.name       Then ' if the name of the Sht is not the name of the current sheet then start creating hyperlinks in the current worksheet            i = i + 1           ' accumulate I           ActiveSheet.Hyperlinks.Add Anchor:=cells (i, 1), address:= "", subaddress:= "'" & Shtname & "'!a1", Texttodisplay:=shtname           ' built-in hyperlink        End If    nextend Sub

  

Data analysis----The use of VBA

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.