Function pinyin(p As String) As String i = Asc(p) Select Case i Case -20319 To -20318: pinyin = "a " Case -20317 To -20305: pinyin = "ai " Case -20304 To -20296: pinyin = "an " Case -20295 To -20293: pinyin = "ang "
1.合并字符串A1&A22.拆分字符串LEFT(A2,SEARCH("-",A2)-1)3.下拉选项Data->Data validation->List 1.在工具栏上显示开发选项 2.新建个Module就可以在几个sheet里共享变量 Public cn As New ADODB.Connection Public strCn As String Public strCom As String Public rs As New ADODB.Recordset P
EXCEL的VBA编程 杨康需要我完成的需求 第一列是名称 第二列是甲方账户 第三列是甲方金额 第四列是乙方账户 第五列是乙方金额 第六列是true或false 第七列备注 需求 开始时数据对齐的,如果甲方金额比乙方金额大,就将交易名称,甲方账户,甲方金额下移一行,反之则将乙方账户,乙方金额下移一行 最终效果图 我的代码 Sub func() Dim pos, total, mate1 Rem 获取行数 total = Sheet1.UsedRange.Rows.Count Rem 开始循环 F
动态执行文本vba代码 Public Sub StringExecute(s As String) Dim vbComp As Object Set vbComp = ThisWorkbook.VBProject.VBComponents.Add(1) vbComp.Name = "aaa" vbComp.CodeModule.AddFromString "Sub foo" & vbCrLf & s & vbCrLf & "
批量将CSV导入access alt+f11 打开access的vbe环境 Sub test() Dim SQL As String Dim MyPath As String Dim MyPathDb As String Dim MyFile As String MyPath = "D:\temp\*.CSV" MyPathDb = "D:\temp" MyFile = Dir(MyPath) Do SQL = "insert into 110 selec