实现1到40行的第一列 ,全部 累加一个字符串 A1 Sub Macro1() Dim i As IntegerFor i = 1 To 40Sheets(1).Cells(i, 1).Value = Conversion.CStr(Sheets(1).Cells(i, 1).Value) + "_A1"Next iEnd Sub Excel vba Excel2007无法在未启用宏的工作簿中保存vb项目 新建 Microsoft Office Excel 工作表.xlsm http:
工作以后发现excel很强大,用好excel已经成功工作中很重要的一部分内容,最近写了一些宏, 整理如下: 根据excel生成sql脚本的sc_template Sub GenSCTemplateFile() Dim WS As Worksheet Dim WS_Config As Worksheet Set WS_Config = ThisWorkbook.Worksheets("Config") Dim turbineModelSheetName As String turbine
'1.用户可以任意选择文件夹进行遍历 '2.限定遍历时仅搜索EXCEL文件(你可以改变文件类型) '这个程序要先在“引用”下选择"microsoft scripting runtime"库文件 Dim ArryFile() As String Dim nFile As Integer Sub Filelist() Dim fso As New FileSystemObject Dim fd As Folder Dim strFilePath As String Dim FolderSe
用处:将大容量的EXCEL工作簿分解成若干个小的工作簿 Sub aa() For i = 1 To 8 Set nb = Workbooks.Add nb.SaveAs Filename:=ThisWorkbook.Path & "" & i nb.Activate With ThisWorkbook.Sheets(1) .Range(.Cells(100000 * (i - 1) + 1, 1), .Cells(100000 * i + 1, 14)).Copy [a
Sub addwork() Rem 当前宏是根据学生数量 .每考场人数计算工作表数Dim i As IntegerRem xx为每个考场的人数Rem yy为当前专业标记Rem mm为当前专业考生人数Rem shu为当前专业考号张数Rem shuu为当前专业考场数量xx = 44yy = 2001mm = 999 If Int(mm / xx) = mm / xx Thenshuu = mm / xxElseIf Int(mm / xx) <> mm / xx Thenshuu = Int(mm
Sub fun1() '统计每一个sheet有多少行数据 Set s1 = Sheets("Sheet1") 'totalok = 0 To Sheets.Count s1.Cells(i, ) = Sheets(i).Name r = Sheets(i).Range("A65535").End(xlUp).Row s1.Cells(i, ) = r Then totalok = totalok + r End If Next s1.Cells(, ) = tota
Dim cuttent_columns As Integer Dim care_repeat As Integer Private Sub Workbook_Open() Dim i As Integer Dim j As Integer '确定cuttent_columns的值 For i = 1 To 100 If Cells(1, i) = "" Then For j = i To 100 If Cells(1, j) = "" Then Else cutte
出于提高效率的原因,希望excel能够不需要人为干预的完成一些操作,学习excel宏的编写与调试: 第一列输入公式,第二类输出计算结果:(如果自动获取文件的行数,待补充) Sub Calc() a = [a1].Value [b1].Value = Evaluate(a) a = [a2].Value [b2].Value = Evaluate(a) a = [a3].Value [b3].Value = Evaluate(a) End Sub 改进:自动识别行数 Sub Calc() Dim