function是有返回值的函数,是最基本的概念。一般用函数名=值的方式来返回。
split是分割字符串,建议网上搜一下,你这些问题都容易搜到答案。
你可以先下载个vb6.0来练习一下vb的语法。
追问split分割一个变量,然后用的是vbcrlf我记得是这种特殊的定义,一般怎么用,
追答那就是把多行分割为行的数组。
追问问最后一个,没事把。我们工作时,xls里面的代码已经写好,他们都放在了,excel工具栏里点,怎么做到的
追答参考一下我写的代码:
Sub MakeMenu()
' Creates a new menu and adds menu items
Dim Cap(1 To 15)
Dim Mac(1 To 15)
Dim NewMenu As CommandBarControl
Dim Item As CommandBarControl
Dim MenuCount As Integer
Dim I As Integer
Cap(1) = "»ã×Ü"
Mac(1) = "CalcInOutTotal"
' Delete the menu if it already exists
On Error Resume Next
Application.CommandBars(1).Controls("³öÈë¿â").Delete
On Error GoTo 0
' Add the menu
MenuCount = Application.CommandBars(1).Controls.Count
Set NewMenu = Application.CommandBars(1).Controls.Add(Type:=msoControlPopup, Before:=MenuCount, temporary:=True)
NewMenu.Caption = "&³öÈë¿â"
' Add the menu items
For I = 1 To 1
Set Item = NewMenu.Controls.Add(Type:=msoControlButton, temporary:=True)
With Item
.Caption = Cap(I)
.OnAction = Mac(I)
If I Mod 4 = 0 Then .BeginGroup = True
End With
Next I
End Sub
追问很感谢,采纳了,不过那个6.0 vba练习语法的是什么,软件么?