本帖最后由 intellectual1 于 2011-03-18 15:50:50 编辑

解决方案 »

  1.   

    去  开发语言→office开发/VBA 版块
      

  2.   


    /*
    A B C D E F
    1 Cc12 Cc13 Cc14 Cc15 Cc16
    2 Cc13 背景色
    3 Cc15 背景色 背景色 背景色 
    */declare @b int    --字段的数据类型,用int为例!
    declare @c int
    declare @d int
    declare @e int
    declare @f int
    declare @beijing int  --背景色
    select @b = b,@c = c,@d = d,@e = e,@f = f from tb where a = 1update tb
    set b = (case when b < @b then @beijing else b end),
        c = (case when c < @c then @beijing else c end),
        d = (case when d < @d then @beijing else d end),
        e = (case when e < @e then @beijing else e end),
        f = (case when f < @f then @beijing else f end)
    where a > 1
      

  3.   

    是一张excel 表
    数据如下,直接复制到excle中。
    谁会写宏?
    CC12 CC13 CC14 CC15 CC16
    CC13 背景色
    CC15 背景色 背景色 背景色
      

  4.   

    我要写excel 宏,不是sql。
    对不起,没有说清楚。
      

  5.   

    http://topic.csdn.net/u/20070821/07/985327ac-ff56-40d8-adec-a45897317a36.htmlhttp://office.microsoft.com/zh-cn/excel-help/HA001136627.aspx我感觉这俩一结合就差不多了,你比我聪明你肯定能看懂我觉得我都快看懂了
      

  6.   

     
    主要还是几个函数的问题If   Range( "h4 ").Value   >   0.01   And   Range( "h4 ").Value   <   0.02   Then 
              x   =   Range( "h4 ").Value   -   0.01 
              Range( "c4 ").Value   =   Int((1   -   Range(h4).Value   -   Range( "g4 ").Value)   *   Range( "b4 ").Value) 
    Range("A1:A6").Interior.Color = RGB(200,160,35)