乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > <em>VBA</em> <em>Excel</em>如何在工作表区域内

<em>VBA</em> <em>Excel</em>如何在工作表区域内

作者:乔山办公网日期:

返回目录:excel表格制作


A列 各单zd元格 与B列个单元格 比较

dim i ,j
for i=1 to range("a65536").end(3).row
for j=1 to range("b65536").end(3).row
if rang("a" & i)=rang("b" & j) then
......

end if

next

next

Sub 查找()
For Each rng In Range("a1:d3")
    If rng = 7 Then
        a = rng.Row
        b = rng.Column
    End If
Next
MsgBox "行号" & a & "-" & "列号为" & b
End Sub

sub a()
    dim rng as range,rngSearch as range
    dim vl as string
    set rng=range("A1:B100")
    vl="AAA" 
    set rngSearch=rng.find(what:=vl)
    if not rngSearch is nothing then msgbox vl.column
end sub


你的代码错误不是一点点,有的基本概念没弄清楚,比如find函数,在VBA当中与在工作表当中,用法并不一样,给你更改代码如下:

Sub dd()
    Dim x%, y%
    x = Range("A65536").End(xlUp).Row
    For y = 2 To x
        If Range("A" & y) = Range("E1") Then
            Range("E2") = Range("B" & y)
        End If
    Next
End Sub

相关阅读

关键词不能为空
极力推荐
  • <em>excel</em> vba使用输入框来<em>筛选</em>内

  • excel vba语言里如何筛选文本框里的文本?" src="/uploads/tu/512.jpg" style="width: 400px; height: 267px;" />简单来说,就是添加一个 TextBox 控件,然后写一段响应 TextBox.Change 事件的copy过程代码,其

ppt怎么做_excel表格制作_office365_word文档_365办公网