欢迎来到天天文库
浏览记录
ID:20151279
大小:962.50 KB
页数:37页
时间:2018-10-09
《excel表格复制到cad方法》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、excel表格复制到CAD的方法太复杂了,三下就行了1、在EXCEL中选中表格,按CTRL+C2、打开CAD,按CTRL+V3、调整其大小并移动到需要位置即可excel实现自动生成目录Alt+F11---------插入--------模块--------把下面的代码拷贝到模块中Submulu()OnErrorGoToTuichuDimiAsIntegerDimShtCountAsIntegerDimSelectionCellAsRangeShtCount=Worksheets.CountIfShtCount=0OrShtCoun
2、t=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").DeleteSh
3、ift:=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)="
4、目录"SetSelectionCell=Worksheets("目录").Range("B1")WithSelectionCell.HorizontalAlignment=xlDistributed.VerticalAlignment=xlCenter.AddIndent=True.Font.Bold=True.Interior.ColorIndex=34EndWithApplication.StatusBar=FalseApplication.ScreenUpdating=TrueTuichu:EndSub直接将程序复制过去,运
5、行--用户子过程/用户窗体---搞定我修正了楼主的程序,经过调试可行,不会出现“引用无效”Submulu()OnErrorGoToTuichuDimiAsIntegerDimShtCountAsIntegerDimSelectionCellAsRangeShtCount=Worksheets.CountIfShtCount=0OrShtCount=1ThenExitSubApplication.ScreenUpdating=FalseFori=1ToShtCountIfSheets(i).Name="目录"ThenSheets("
6、目录").MoveBefore:=Sheets(1)EndIfNextiIfSheets(1).Name<>"目录"ThenShtCount=ShtCount+1Sheets(1).SelectSheets.AddSheets(1).Name="目录"EndIfSheets("目录").SelectColumns("B:B").DeleteShift:=xlToLeftApplication.StatusBar="正在生成目录…………请等待!"Fori=2ToShtCountActiveSheet.Hyperlinks.AddAn
7、chor:=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=xlDistrib
8、uted.VerticalAlignment=xlCenter.AddIndent=True.Font.Bold=True.Interior.ColorIndex=34EndWithApplication.StatusBar=FalseApplic
此文档下载收益归作者所有