第一个SHEET的名字改为:目录点击:Alt+F11---插入--------模块--------把下面的代码拷贝到模块中Submulu()OnErrorGoToTuichuDimiAsIntegerDimShtCountAsIntegerDimSelectionCellAsRangeShtCount=Worksheets.CountIfShtCount=0OrShtCount=1ThenExitSubApplication.ScreenUpdating=FalseFori=1ToShtCountIfSheets(i).Name=目录ThenSheets(目录).MoveBefore:=Sheets(1)EndIfNextiIfSheets(1).Name目录ThenShtCount=ShtCount+1Sheets(1).SelectSheets.AddSheets(1).Name=目录EndIfSheets(目录).SelectColumns(B:B).DeleteShift:=xlToLeftApplication.StatusBar=正在生成目录…………请等待!Fori=2ToShtCountActiveSheet.Hyperlinks.AddAnchor:=Worksheets(目录).Cells(i,2),Address:=,SubAddress:=_'&Sheets(i).Name&'!R1C1,TextToDisplay:=Sheets(i).NameNextSheets(目录).SelectColumns(B:B).AutoFitCells(1,2)=目录SetSelectionCell=Worksheets(目录).Range(B1)WithSelectionCell.HorizontalAlignment=xlDistributed.VerticalAlignment=xlCenter.AddIndent=True.Font.Bold=True.Interior.ColorIndex=34EndWithApplication.StatusBar=FalseApplication.ScreenUpdating=TrueTuichu:EndSub关闭模块窗口回到excel中按alt+F8在弹出“宏”窗口中选择“建立连接”,再点击“执行”