33 应用程序定义或对象定义错误 34 应用程序定义或对象定义错误 35 子过程或函数未定义
36 应用程序定义或对象定义错误 37 应用程序定义或对象定义错误 38 应用程序定义或对象定义错误 39 应用程序定义或对象定义错误 40 应用程序定义或对象定义错误 41 应用程序定义或对象定义错误 42 应用程序定义或对象定义错误 43 应用程序定义或对象定义错误 44 应用程序定义或对象定义错误 45 应用程序定义或对象定义错误 46 应用程序定义或对象定义错误 47 DLL 应用程序客户太多 48 加载 DLL 错误 49 DLL 调用约定错误
50 应用程序定义或对象定义错误 51 内部错误
52 文件名或文件号错误 53 文件未找到 54 文件模式错误 55 文件已打开
56 应用程序定义或对象定义错误 57 设备 I/O 错误 58 文件已存在 59 记录长度错误
60 应用程序定义或对象定义错误 61 磁盘已满 62 输入超出文件尾 63 记录号错误
64 应用程序定义或对象定义错误 65 应用程序定义或对象定义错误 66 应用程序定义或对象定义错误 67 文件太多 68 设备不可用
69 应用程序定义或对象定义错误 70 拒绝的权限 71 磁盘未准备好
72 应用程序定义或对象定义错误 73 应用程序定义或对象定义错误 74 不能更名为不同的驱动器 75 路径/文件访问错误 76 路径未找到
77 应用程序定义或对象定义错误 78 应用程序定义或对象定义错误
79 应用程序定义或对象定义错误 80 应用程序定义或对象定义错误 81 应用程序定义或对象定义错误 82 应用程序定义或对象定义错误 83 应用程序定义或对象定义错误 84 应用程序定义或对象定义错误 85 应用程序定义或对象定义错误 86 应用程序定义或对象定义错误 87 应用程序定义或对象定义错误 88 应用程序定义或对象定义错误 89 应用程序定义或对象定义错误 90 应用程序定义或对象定义错误 91 对象变量或 With 块变量未设置 92 For 循环未初始化 93 无效的模式串 94 无效使用 Null
95 应用程序定义或对象定义错误
96 由于对象已经激活了事件接受器支持的最大数目的事件,不能吸收对象的事件 97 不能调用对象的友元函数,该对象不是所定义类的一个实例。
98 属性或方法调用不能包括对私有对象的引用,不论是作为参数还是作为返回值 99 应用程序定义或对象定义错误 100 应用程序定义或对象定义错误
122、Private Sub Calendar1_Click() ActiveCell = Me.Calendar1.Value End Sub
123、设置日历控件字号 Private Sub UserForm_Initialize() Me.Calendar1.GridFont.Size = 14 End Sub
124、以下是从金刚金作品里提出来的部份事件代码,做得很好,值得借鉴学习: Private Sub Workbook_Activate()
MsgBox \工作簿被切换为作用工作簿\End Sub
Private Sub Workbook_AddinInstall()
MsgBox \激活新的加载宏时\ End Sub
Private Sub Workbook_AddinUninstall()
MsgBox \取消以前选取的加载宏时\ End Sub
Private Sub Workbook_BeforeClose(Cancel As Boolean)
MsgBox \工作簿被关闭之前\End Sub
Private Sub Workbook_BeforePrint(Cancel As Boolean)
MsgBox \工作簿打印之前\End Sub
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) MsgBox \工作簿进行保存之前\End Sub
Private Sub Workbook_Deactivate()
MsgBox \工作簿切换为非作用工作簿\End Sub
Private Sub Workbook_NewSheet(ByVal Sh As Object) MsgBox \新建工作表\End Sub
Private Sub Workbook_Open()
MsgBox \打开工作簿\End Sub
Private Sub Workbook_PivotTableCloseConnection(ByVal Target As PivotTable)
MsgBox \数据透视表关闭与其数据源的连接之后\End Sub
Private Sub Workbook_PivotTableOpenConnection(ByVal Target As PivotTable)
MsgBox \数据透视表打开与其数据源的连接之后\End Sub
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
MsgBox \工作表\切换为作用工作表\End Sub
Private Sub Workbook_SheetBeforeDoubleClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) MsgBox \任一单元格双击鼠标之后\End Sub
Private Sub Workbook_SheetBeforeRightClick(ByVal Sh As Object, ByVal Target As Range, Cancel As Boolean) MsgBox \任一单元格单击鼠标右键之后\End Sub
Private Sub Workbook_SheetCalculate(ByVal Sh As Object)
MsgBox \工作表内容进行重算之后\End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range) MsgBox \在工作表内进行不同的操作\End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
MsgBox \工作表\切换为非作用工作表\End Sub
Private Sub Workbook_SheetFollowHyperlink(ByVal Sh As Object, ByVal Target As Hyperlink) MsgBox \按下Excel超链接之后\End Sub
Private Sub Workbook_SheetPivotTableUpdate(ByVal Sh As Object, ByVal Target As PivotTable) MsgBox \数据透视表更新之后\End Sub
Private Sub Workbook_SheetSelectionChange(ByVal Sh As Object, ByVal Target As Range) MsgBox \工作表里选取不同单元格范围时\
End Sub
Private Sub Workbook_WindowActivate(ByVal Wn As Window)
MsgBox \工作簿切换为作用工作簿\End Sub
Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
MsgBox \工作簿切换为非作用工作簿\End Sub
Private Sub Workbook_WindowResize(ByVal Wn As Window)
MsgBox \工作簿被打开或窗口最大化、最小化之后\End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox \选取不同单元格范围时\End Sub
125、Rem 选定单元格的个数 Sub t()
MsgBox Selection.Cells.Count End Sub
126、Application.OnKey \禁用F11 127、'选中A列除A1外的第一个非空单元格 [a65536].End(xlUp).Offset(1, 0).Select 128、Private Sub CommandButton1_Click()
On Error GoTo ad '注意后面的ad,这是错误处理的用法 i = Range(\Sheets(CStr(i)).Select
ret = MsgBox(\是否覆盖\If ret = vbYes Then
Range(\重点在copy之后 Else
Sheets.Add.Name = i & \
Range(\End If End ad:
Sheets.Add.Name = i '工作表名的变化是可见的 Range(\End Sub
129、用变量取代Sheet1中的―1‖ For i = 1 To 3
Sheets(\Next
130、中英对照
English 繁體中文 簡体中文
Absolute Referencing 絕對參照 绝对引用 Active Cell 現存儲存格 活动单元格 Add-in 增益集 加载宏 Address 位址 地址
Array 陣列 数组
Array Formula 陣列公式 数组公式 Audit 稽核 审核 Bold 粗體 粗体 Bug 蟲 Bug Cell 儲存格 单元格
Circular Reference 循環參照 循环引用 Code 程式碼 代码 Column 欄 列 Command 指令 命令 Comment 註解 注释 Condition 條件 条件 Constant 常數 常数 Cursor 浮標 指针 Cursor 游標 鼠标指针 Data 數據/資料 数据 Data Type 資料型態 数据类型 Debug 偵錯 调试 Debug 除蟲 调试 Declare 宣告 声明 Dependent 從屬 从属 Dialog Box 對話方塊 对话框 Double 雙精度浮點數 双精度浮点数 Double-click (on mouse) 雙按 双击 Drag 拖曳 拖曳
Drop-down Box 清單方塊 ? Edit 編緝 编辑
Electronic Mail / Email 電郵/電子郵件 电子邮件 Event 事件 事件 Execute 執行 执行 File 檔案 文件 Filter 篩選 筛选
Flowchart 流程圖 流程图 Footer 頁尾 页脚 Form 表單 窗体 Format 格式 格式 Function 函數 函数 General 一般 标准 Hard Copy 硬本 硬拷贝 Header 頁首 页眉 Help 說明 帮助
Hyperlink 超連結 超级链接
Immediate Window 即時運算視窗 立即窗口 Indent 縮排 缩进 Insert 插入 插入 Internet 互聯網 因特网