查找excel表格中a列的一个内容为”汇总 “ 的单元格,并返回单元格的地址,应该怎样写啊?

解决方案 »

  1.   

    dim i as long
    for i=1 to 65535
        if "汇总"=sheet1.cells(i,1) then
            exit for
        exit
    next
    msgbox "a" & i
      

  2.   

    dim i as long 
    for i=1 to 65535 
        if "汇总"=sheet1.cells(i,1) then 
            exit for 
        end if 
    next 
    msgbox "a" & i
      

  3.   

    可以用find呀
    Sub Find_01()
     Set wcell = Worksheets("sheet1").Cells.Find("汇总", LookIn:=xlValues)
             iLeaderRow = Int(wcell.Row)
             iLeaderCol = Int(wcell.Column)
    End Sub
    应该可以了,你看看吧,可以的话,记得给分分哟
      

  4.   

    icell = xlSheet1.Cells.Find(what:="汇总").Address
    我是这样写的