ThisWorkbook.Path数组 |
获取当前目录spa |
sheetXXX.UsedRange.Rows.Countexcel |
获取当前sheet页使用的行数code |
|
|
MsgBox("hello world")orm |
弹窗事件 |
Dim data As Worksheet Set data = Sheets("录入表") |
定义 |
Debug.printci |
当即窗口get |
Dim targetarray() As Stringit |
定义数组 |
IsNumeric(mtotalcharge) |
判断是数字 |
originArray = Split(origin, Chr(10)) |
用回车来分割 |
UBound(originArray) |
数组最大下标 |
LBound(originArray) |
数组最小下标 |
Dim i As Integer For i = LBound(originArray) To UBound(originArray) If i = 2 Then Exit For Debug.Print originArray(i) Debug.Print "-----------" Next |
循环数组 跳出数组 |
Cstr |
转换成文本 |
Dim date1 As Date date1 = sheetSource.Range("A1").Value datestr = UCase(Format(date1, "ddMMM"))
|
日期格式化 |
UCase |
大写 |
Cells(24, 4) |
根据行号列号选中单元格 |
sheet_FHL.Range("b2", "c2").Clear |
清理数据 |
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If Target.Address = "$B$4" Then |
单元格内回车触发事件 |
Sub createFile() |
生成excel文件 |