Foxtable(狐表)用户栏目专家坐堂 → 隐藏列名包含特定字符的列


  共有1415人关注过本帖树形打印复制链接

主题:隐藏列名包含特定字符的列

帅哥哟,离线,有人找我吗?
fubblyc
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2355 积分:16187 威望:0 精华:0 注册:2013/9/1 8:09:00
隐藏列名包含特定字符的列  发帖心情 Post By:2016/12/2 15:01:00 [只看该作者]

不想显示所有同比环比占比的值,需要隐藏。

用的土办法,如下:如果有这个列,则隐藏,但是很多列,代码冗长。

有没有别的办法,比如遍历列,列名有包含gdr、stp、cle的,就隐藏这些列。

 

 

    'If Tables(e.Form.Name & "_table1").Cols.Contains("总吊牌金额gdr") Then  
        'Tables(e.Form.Name & "_table1").Cols("总吊牌金额gdr").Visible = False
    'End If
    'If Tables(e.Form.Name & "_table1").Cols.Contains("总吊牌金额stp") Then  
        'Tables(e.Form.Name & "_table1").Cols("总吊牌金额stp").Visible = False
    'End If
    'If Tables(e.Form.Name & "_table1").Cols.Contains("总吊牌金额cle") Then  
        'Tables(e.Form.Name & "_table1").Cols("总吊牌金额cle").Visible = False
    'End If
'
    'If Tables(e.Form.Name & "_table1").Cols("VIP小piao数gdr") Then  
        'Tables(e.Form.Name & "_table1").Cols("VIP小piao数gdr").Visible = False
    'End If
    'If Tables(e.Form.Name & "_table1").Cols("VIP小piao数stp") Then  
        'Tables(e.Form.Name & "_table1").Cols("VIP小piao数stp").Visible = False
    'End If
    'If Tables(e.Form.Name & "_table1").Cols("VIP小piao数cle") Then  
        'Tables(e.Form.Name & "_table1").Cols("VIP小piao数cle").Visible = False
    'End If
'
'
    'If Tables(e.Form.Name & "_table1").Cols("总小piao数gdr")Then  
        'Tables(e.Form.Name & "_table1").Cols("总小piao数gdr").Visible = False
    'End If
    'If Tables(e.Form.Name & "_table1").Cols("总小piao数stp") Then  
        'Tables(e.Form.Name & "_table1").Cols("总小piao数stp").Visible = False
    'End If
    'If Tables(e.Form.Name & "_table1").Cols("总小piao数cle") Then  
        'Tables(e.Form.Name & "_table1").Cols("总小piao数cle").Visible = False
    'End If

[此贴子已经被作者于2016/12/2 15:00:54编辑过]

 回到顶部
帅哥哟,离线,有人找我吗?
有点蓝
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:107680 积分:547721 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/12/2 15:19:00 [只看该作者]


 回到顶部
帅哥哟,离线,有人找我吗?
fubblyc
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:九尾狐 帖子:2355 积分:16187 威望:0 精华:0 注册:2013/9/1 8:09:00
  发帖心情 Post By:2016/12/2 15:31:00 [只看该作者]

嗯嗯。谢谢!!

 

For Each c As Col In Tables("零售报表_table1").Cols
If c.name.EndsWith("stp") Or c.name.EndsWith("cle") Or c.name.EndsWith("glp") Then
c.Visible = False
End If
Next

 

 


 回到顶部