没门 发表于 2021-10-27 13:40:00

一键隐藏合计数据为0的列

列很多,但是我只想看到有数据的列,怎么隐藏数据为0的列,求教各位大侠

低吟轻语 发表于 2021-12-9 11:12:04

.....................

我也想说 发表于 2021-12-29 15:02:02

Sub test1()
Dim Rng As Range
Dim Rng1 As Range
For Each Rng1 In Range("G19").CurrentRegion
If Rng1.Value = 0 Then
    If Rng Is Nothing Then
      Set Rng = Rng1
    Else
      Set Rng = Union(Rng, Rng1)
    End If
End If
Next
Rng.EntireColumn.Hidden = True
End Sub
页: [1]
查看完整版本: 一键隐藏合计数据为0的列