文档介绍:excel表格复制到CAD的方法
太复杂了,三下就行了
1、在EXCEL中选中表格,按CTRL+C
2、打开CAD,按CTRL+V
3、调整其大小并移动到需要位置即可
excel实现自动生成目录
Alt+F11---------插入--------模块--------把下面的代码拷贝到模块中
Sub mulu()
On Error GoTo Tuichu
Dim i As Integer
Dim ShtCount As Integer
Dim SelectionCell As Range
ShtCount =
If ShtCount = 0 Or ShtCount = 1 Then Exit Sub
= 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(1).Name = "目录"
End If
Sheets("目录").Select
Columns("B:B").Delete Shift:=xlToLeft
= "正在生成目录…………请等待!"
For i = 2 To ShtCount
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
. = True
. = 34
End With
= False
= True
Tuichu:
End Sub
直接将程序复制过去,运行--用户子过程/用户窗体---搞定
我修正了楼主的程序,经过调试可行,不会出现“引用无效”
Sub mulu()
On Error GoTo Tuichu
Dim i As Integer
Dim ShtCount As Integer
Dim SelectionCell As Range
ShtCount =
If ShtCount = 0 Or ShtCount = 1 Then Exit Sub
= 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(1).Name = "目录"
End If
Sheets("目录").Select
Columns("B:B").Delete Shift:=xlToLeft
= "正在生成目录…………请等待!"
For i = 2 To ShtCount
Anchor:=Worksheets("目录").Cells