excel vba getting the row,cell value from selection.address

后端 未结 2 830
一整个雨季
一整个雨季 2021-02-19 15:58
For i = 1 To 20

  \'\' select the cell in question
  Cells.Find(...).Select

  \'\' get the cell address

  CellAddr = Selection.Address(False, False, xlR1C1) 



Next
         


        
2条回答
  •  自闭症患者
    2021-02-19 16:31

    Dim f as Range
    
    Set f=ActiveSheet.Cells.Find(...)
    
    If Not f Is Nothing then
        msgbox "Row=" & f.Row & vbcrlf & "Column=" & f.Column
    Else
        msgbox "value not found!"
    End If
    

提交回复
热议问题