我使用大型数据集,我只想查看包含某些重要数据点的行。我想要查看的点将根据输入框指定。到目前为止,我可以做一些突出重要细胞的事情,但是我无法隐藏整行。以下是我到目前为止的情况:
Private Sub CommandButton1_Click()
Dim strResult As String
strResult = InputBox(Prompt:="Please Enter Number", Title:="Data Entry:")
Set r = Range("A:B")
For Each cell In r
If cell.Value <= strResult Then cell.EntireRow.Hidden = True
Next
UserForm1.Hide
End Sub
答案 0 :(得分:1)
考虑输入数字
Dim strResult As Long
strResult = Application.InputBox(Prompt:="Please Enter Number", Title:="Data Entry:", Type:=1)
Set r = Intersect(ActiveSheet.UsedRange, Range("A:B"))
For Each cell In r
If cell.Value <= strResult Then cell.EntireRow.Hidden = True
Next
答案 1 :(得分:-1)
你可以试试这个肯定会为你工作
Private Sub Hide_btn_Click()
h = InputBox("Enter Column start Range to Hide the Column - Example A:C")
Columns((h)).EntireColumn.Hidden = True
End Sub
你也可以给出条件
由于