标签:新建 vba net cti saveas box this xlsx highlight
Sub gongzuobu() Dim my_path As String Dim wb As Workbook Dim num As Integer Set wb = Workbooks("工作簿1.xltm") ‘建立工作簿对象 Set wb = Workbooks(1) Set wb = ActiveWorkbook Set wb = ThisWorkbook ‘MsgBox wb.Name ‘Workbooks.Add ‘新建工作簿 ‘ ‘ActiveWorkbook.SaveAs "C:\Users\queqiaoshui\Desktop\haha.xlsx" ‘保存工作簿 ‘my_path = wb.Path ‘获取当前工作簿文件目录 ‘MsgBox my_path num = Application.WorksheetFunction(2, 9) ‘利用工作表函数取随机数 MsgBox num End Sub
标签:新建 vba net cti saveas box this xlsx highlight
原文地址:https://www.cnblogs.com/queqiaoshui/p/10262628.html