ocument.TablesOfFigures.Count''返回当前文档中的图表目录数---Paragraphs/Paragraph对象(353)Selection.Paragraphs.Count''返回所选区域的段落数(354)Selection.Paragraphs.First''返回所选区域中的第一段(355)ActiveDocument.Paragraphs(1).LeftIndent''返回当前文档中第一段的左缩进值(356)ActiveDocument.Paragraphs(1)...
42、GetAddress=Replace(Hyperlinkcell.Hyperlinks(1).Address,mailto:,"") '返回单元格中超级链接的地址并赋值 43、TextColor=Range("A1").Font.ColorIndex '检查单元格 A1的文本颜色并返回颜色索引 ,Range("A1").Interior.ColorIndex '获取单元格 A1背景色 44、cells.count '返回当前工作表的单元格数 45、Sel...
clok = Split("策略OK," & GetProcedureList("策略OK", 1), ",") clwc = Split("策略未定," & GetProcedureList("策略未测", 1), ",") hcok = Split("回测OK," & GetProcedureList("回测OK", 1), ",") hcz = Split("回测中," & GetProcedureList("回测中", 1), ",") Set sb ...
Public Function removeFirstC(rng As String, cnt As Long) removeFirstC = Right(rng, Len(rng) - cnt) End Function Simply remove characters from the starting of a text string. All you need is to refer to a cell or insert a text into the function and number of characters to remove from ...
fm = Application.GetOpenFilename(fileFilter:="Excel files(*.xls),*.xls, All files (*.*),*.*") If fm <> False Then Workbooks.Open fm Set bb = ActiveWorkbook '把bb 变量设为当前活动工作簿对象,打开一工作簿时,该工作簿自动为当前活动工作簿 ...
Sub GetFileNames() Dim FileName As String FileName = Dir('C:\a\c\3panda.txt') Debug.Print FileName End Sub 运行后,在立即窗口(Immediate Window)中显示的是: 3panda.txt 如果指定路径的文件不存在,则Dir函数返回空字符串。以下是改进后的代码。
Sub GetDocumentName() Dim strDocName As String strDocName = ActiveDocument.Name MsgBox strDocName End Sub 在本示例中,ActiveDocument引用Word活动窗口中的文档。该文档的名称赋给了strDocName变量。 说明 每个属性的“帮助”主题表明可以设置该属性(可读写),只能读取该属性(只读),或只能写入该属性(只写)。此...
JSON conversion and parsing for VBA. Contribute to VBA-tools/VBA-JSON development by creating an account on GitHub.
'inputbox反回值是String型,利用CByte转换成Byte型Star:Months = CByte(InputBox("请指定月份,程序将生成该月的月历", "月份", Month(Date), 10, 10)) If err <> 0 Then err.Clear: GoTo Star'如果有错误则返回重新输入 If Months < 1 Or Months > 12 Then MsgBox "只能在1-12之间,请重新输入。"...
▌GetAllSettings( appname, section ) as Array 更多▌GetAttr( pathname As String) as Integer 返回表示文件、目录或文件夹的属性的 Integer 。 GetAttr 所返回的值是以下属性值的和: 常量值说明 vbNormal 0 正常。 vbReadOnly 1 只读。 vbHidden 2 可见. vbSystem 4 系统文件。 在 Macintosh 上不可用。