我想将A列的数据复制到cad命令栏,求这样的excel VBA
1个回答
展开全部
Sub outScr()
Application.ScreenUpdating = False
D_File = ThisWorkbook.Path & "\" & "ABC.scr"
myLastRow = activesheet.Cells.SpecialCells(xlCellTypeLastCell).Row
myFNo = FreeFile
Open D_File For Output As #myFNo
For i = 1 To myLastRow
Print #myFNo, activesheet.Cells(i, 1)
Next
Close myFNo
Application.ScreenUpdating = True
End Sub
然后在cad中执行这个ABC.scr就可以了
Application.ScreenUpdating = False
D_File = ThisWorkbook.Path & "\" & "ABC.scr"
myLastRow = activesheet.Cells.SpecialCells(xlCellTypeLastCell).Row
myFNo = FreeFile
Open D_File For Output As #myFNo
For i = 1 To myLastRow
Print #myFNo, activesheet.Cells(i, 1)
Next
Close myFNo
Application.ScreenUpdating = True
End Sub
然后在cad中执行这个ABC.scr就可以了
追问
没有直接到cad的么 在cad中执行scr文件的话 就可以直接在命令栏直接粘贴数据了
追答
你可以做个按钮直接执行scr啊。。。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询