VBA 统计文件(规则:'\'以后的文件名)
来源:互联网 发布:ubuntu安装分区方案 编辑:程序博客网 时间:2024/05/18 01:59
说明:
1第一个sheet名为Sheet1,第二个名为step
2两个sheet相比较,如果相同,将step的第五列,放到Sheet1的第二列
Sub countStep()'' countStep Macro'' Keyboard Shortcut: Ctrl+Shift+TDim sheetYCnt As IntegerDim stepYCnt As IntegerDim sheetName As StringDim stepName As StringsheetName = "Sheet1" 'result page namestepName = "step" 'result from page namesheetYCnt = Worksheets(sheetName).UsedRange.Rows.CountstepYCnt = Worksheets(stepName).UsedRange.Rows.CountFor i = 1 To sheetYCnt Dim fileName As String ' read column 1 of result page fileName = Worksheets(sheetName).Cells(i, 1).Value For j = 1 To stepYCnt Dim fullName As String Dim lastWord As String Dim index As Integer fullName = Worksheets(stepName).Cells(j, 1).Value ' read column 1 of result from page 'substr String from last '\' to end index = InStrRev(fullName, "\") lastWord = Mid(fullName, index + 1) If fileName = lastWord Then ' column 5 (result from page )-> column 1 (result page) Worksheets(sheetName).Cells(i, 2).Value = Worksheets(stepName).Cells(j, 5).Value End If NextNextMsgBox "End"End Sub
- VBA 统计文件(规则:'\'以后的文件名)
- VBA 统计文件(规则:A包含B)
- VBA 统计文件个数
- vba 跨文件统计
- 长文件名的规则
- 短文件名的命名规则
- 中文名文件上传到linux服务器上以后文件名会乱码(openoffice)
- word vba批量替换文件内容并批量修改文件名
- VBA 检查文件或文件名是否存在
- 【VBA】VBA打开文件选择框、取得文件全路径与文件名
- VBA 范例教程(02):跨应用程序的操作(多文件统计)
- VBA文件对话框的应用(VBA打开文件、VBA选择文件、VBA选择文件夹)
- VBA文件对话框的应用(VBA打开文件、VBA选择文件、VBA选择文件夹)
- 内部类生成文件名的规则
- linux目录和文件名的命名规则
- 浅谈VBA和.NET中文件名信息的处理
- Excel VBA批量修改文件夹下的文件名
- 报废统计报表的规则
- DataTable使用技巧总结
- PhoneGap 布局(一)
- Gerrit2启用HTTP基本验证
- oracle密码过期错误 ORA-28002
- 还真有不少的话题
- VBA 统计文件(规则:'\'以后的文件名)
- 如何清空串口接收数据显示框(EDIT控件)的数据
- paip.c#图片裁剪
- ZJUT 2012校赛决赛-涂颜色
- arm汇编学习
- 编写高效的Android代码
- Linux 调整 sysctl 解决warning, got duplicate tcp line
- 科普研究:三网融合与中国科普电视的新生
- Unix domain socket 的一些小结