excel - 如何将 Line2 中的每个单元格与 Line1 进行比较
问题描述
我正在开发一个脚本,它将遍历 line2 中的每个单元格,并在 Line1 中找到相同的单元格,并计算有多少是相同的。现在我被困住了。
Sub compare()
final_col = Cells(7, 250).End(xlToLeft).Column
Dim i As Integer, j As Integer
Dim Line1 As Range
Dim Line2 As Range
Match = 0
Line1 = Range(Cells(4, 7), Cells(7, final_col))
Line2 = Range(Cells(12, 7), Cells(7, final_col))
For Each i In Line2
For Each j In Line1
If i = j Then
Match = +1
End If
Next j
Next i
End Sub
为每个循环填充数据的最佳方法是什么。
解决方案
推荐阅读
- android - Talkback - 自定义 View Pager 滑动的辅助功能文本
- angular-cli - 设置 Angular CLI 生成默认值
- python - Emacs 粉丝如何在 Python 项目上协作时让 Visual Studio 爱好者满意?
- php - 在另一个 php 页面上显示对象时出现问题
- python - Spacy 文本分类:获取错误消息“'float' object is not iterable”
- c# - 如何检查用户是否已授予应用程序对图片文件夹的权限?
- here-api - Here's 平台是否有本地(离线)版本?
- r - 如何根据嵌套在团队中的二元数据创建唯一 ID,以便在列中创建唯一的团队标识?
- javascript - TypeError:无法读取 v-for 中未定义的属性“0”
- python - Python - 需要更长的时间,转换为字符串或转换为浮点数