Request my Excel worksheet using VBA

Can I request a worksheet using VBA?

data table

I want to be able to select all the values ​​in the time column, that is (00:00) WHERE, for example, day: Saturday

I have a way to do this, the tutorial will be really useful.

thank

+5
source share
1 answer

You can program AutoFilter, then select the appropriate values:

Dim ws As Worksheet: Set ws = ActiveSheet

With ws
    .AutoFilterMode = False
    .Range("1:1").AutoFilter
    .Range("1:1").AutoFilter field:=2, Criteria1:="=Saturday", Operator:=xlAnd
    With .AutoFilter.Range
        On Error Resume Next ' if none selected
        .Offset(1).Resize(.Rows.Count - 1).Columns(2).SpecialCells(xlCellTypeVisible).Select
        On Error GoTo 0
    End With
    .AutoFilterMode = False
End With
+4
source

All Articles