如何将EXCEL表中SHEET的名字导出
(一)office的操作方法
- 按下ATL+F11
- 菜单:插入-模块
- 复制下面代码,然后按F5运行。会在最前面加张总表,显示工作表名称。
Sub mulu() On Error GoTo Tuichu Dim i As Integer Dim ShtCount As Integer Dim SelectionCell As Range ShtCount = Worksheets.Count If ShtCount = 0 Or ShtCount = 1 Then Exit Sub Application.ScreenUpdating = False For i = 1 To ShtCount If Sheets(i).Name = "目录" Then Sheets("目录").Move Before:=Sheets(1) End If Next i If Sheets(1).Name <> "目录" Then ShtCount = ShtCount + 1 Sheets(1).Select Sheets.Add Sheets(1).Name = "目录" End If Sheets("目录").Select Columns("B:B").Delete Shift:=xlToLeft Application.StatusBar = "正在生成目录…………请等待!" For i = 2 To ShtCount ActiveSheet.Hyperlinks.Add Anchor:=Worksheets("目录").Cells(i, 2), Address:="", SubAddress:= _ Sheets(i).Name & "!R1C1", TextToDisplay:=Sheets(i).Name Next Sheets("目录").Select Columns("B:B").AutoFit Cells(1, 2) = "目录" Set SelectionCell = Worksheets("目录").Range("B1") With SelectionCell .HorizontalAlignment = xlDistributed .VerticalAlignment = xlCenter .AddIndent = True .Font.Bold = True .Interior.ColorIndex = 34 End With Application.StatusBar = False Application.ScreenUpdating = True Tuichu: End Sub
(二)WPS的操作方法
- 自己建立一个Sheet叫“目录”
- 选择建立Sheet的任意位置
- 点击菜单栏的“公式-名称管理器”
- 在弹出的窗口中新建一个管理器
- 管理器的名称就是“目录”,设置引用位置“=GET.WORKBOOK(1)”后关闭窗口
- 在选中的单元格中粘贴:=IFERROR(MID(INDEX(目录,ROW(A2)),FIND("]",INDEX(目录,ROW(A2)))+1,99),""),然后下拉,即可
在excel中,如何实现分母不变,分子变的除法运算
选择需要设置的窗口,填写公式:=C1/$C$20,下拉,即可
2列内容合并成1列
=A1&B2
=A1&" "&B1