室内采光规范:Excel表格内有两列数据如何找出相等的数据

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/20 17:53:21
两列数据每行是不对应相等的。

使用VB,
Excel for VB,
Dim temp,temp2
Dim r,c
temp=workSheets("Sheet1").Values(1,1).text;
for j=currentcol to MAXC
temp=workSheets("Sheet1").Values(j,1).text;
for i=currentrow to MAXR
if workSheets("Sheet1").Values(j,i).text=temp
r=j
i=c
goto Ok
end if
next
next
goto over
OK:
MessageDlg("Ok,有一样的")
goto over
over:
...

假设你的两列数据为 A, B, 在 C列中,输入
=IF(A1=B1,"相等","不等")

然后拖动那个输入的单元格“功能+”