How to find cell value based on row and Column ID in excel VBA

后端 未结 2 1989
故里飘歌
故里飘歌 2021-01-24 19:35

Need a VBA Sub to find a cell value based on Row and Column ID. In the example below I need to select the value where East and RT3 intersect which is 80.

    A   B            


        
2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-24 19:49

    Use similar to below not tested:

    Function getcell(ct as string, rt as string) as range
    
        With activecell
            R = .columns("A").find(rt).row
            C = .rows("1").find(ct).Column
            'The below will escape the function if none where found
            If r = nothing or c = nothing then exit function
            Set getcell = .cells(r, c)
        End with
    
    End function
    

提交回复
热议问题