以chinaboyzyq(猴哥)解答的帖子(在此表示感谢)。
http://topic.csdn.net/u/20100505/20/873b1092-1f4d-4ded-b52f-f839f783e26f.htmlhttp://topic.csdn.net/u/20100507/07/830b6ac3-9785-4a1f-8ae6-cacfef07321d.html
http://topic.csdn.net/u/20100429/19/d0feef9f-dde8-4e5b-9460-159df47f737d.html扩展学习MshFlexGrid知识点,以猴哥的帖子为依据:Sub HFlexgrid_EnterCell()
   '目标需求,单击某一单元时。
   获得行和列的数据。   
End Sub如:
   A1   A2   A3
B1
B2
B3单击单元格(A2,B2)时,
返回行数为2-------得到的数据为B2
返回列数为2-------得到的数据为A2

解决方案 »

  1.   

    这有两个需求。
    与上面需求相反。外部数据提供数据为A2-------循环列数据-----找到列jj=2
    外部数据提供数据为B2-------循环列数据-----找到列ii=2让单元格(B2,A2)变色。将上面需求连在一起,用好,就非常实用了。
      

  2.   

    with mshflexgrid
        .row=b2
        .col=a2
        .cellbackcolor=vbred
    end with
     
      

  3.   

    谢谢,回复。请各位大侠能否再优化一下代码。
    with mshflexgrid
      for ii = 0 to nn1
        if .TextMatrix(ii, 0) = "B2" then
          .Row = ii
          exit for
        end if
      next ii
      ''
      for jj = 0 to nn2
        if .TextMatrix(jj, 0) = "A2" then
          .Col = jj
          exit for
        end if
      next jj
      .CellBackColor = VbRed 
    end with