RE: Filling both hidden and visible cells once a filter has been a

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Sorry Corrie, this procedure should work correctly.

Sub RightFromWrong2()

Dim i As Variant

Sheets("L-G DL").Select
i = ActiveSheet.UsedRange.Rows.Count
Rows("1:1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=14, Criteria1:=">-100", _
Operator:=xlOr, Criteria2:="<100"
Selection.AutoFilter Field:=11, Criteria1:=">10", Operator:=xlAnd
Selection.AutoFilter Field:=12, Criteria1:=">10", Operator:=xlAnd
Range("U2:U" & i).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection = "CORRECT"
Range("U2:U" & i).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection = "INCORRECT"

End Sub
--
Mike Q.


"Mike Q." wrote:

Sub RightFromWrong()

Dim i As Variant

i = ActiveSheet.UsedRange.Rows.Count
Range("U2:U" & i).Select
Selection.SpecialCells(xlCellTypeVisible).Select
Selection = "CORRECT"
Range("U2:U" & i).Select
Selection.SpecialCells(xlCellTypeBlanks).Select
Selection = "INCORRECT"
End Sub
--
Mike Q.


"Corrie" wrote:

I am very new to VBA. So my apologizes first for ignorance if this is
an easy problem to address.

I am trying to fill a column with different data ("incorrect" and
"correct") based on filtered criteria. Example:

Sheets("L-G DL").Select
Rows("1:1").Select
Selection.AutoFilter
Selection.AutoFilter Field:=14, Criteria1:=">-100", Operator:=xlOr,
_
Criteria2:="<100"
Selection.AutoFilter Field:=11, Criteria1:=">10", Operator:=xlAnd
Selection.AutoFilter Field:=12, Criteria1:=">10", Operator:=xlAnd

Once the columns have been filtered I would like to fill the visible
cells (but not the header) in column 21 with the word "correct" and
hidden cells with "incorrect".

Once this is done I will use the new information in a pivot table. I
can't seem to come up with a way to do this. Does anyone have an
approach that may work?


.



Relevant Pages

  • Re: Problem with Dialog
    ... Dim varFiles As Variant ... Text1.AddItem Fname ... result of the selection of the Dialog to be a variant. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Problem with Dialog
    ... Dim varFiles As Variant ... Text1.AddItem Fname ... result of the selection of the Dialog to be a variant. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Problem with Dialog
    ... that LaunchCD doesn't equal the Variant "V"? ... Dim varFiles As Variant ... Text1.AddItem Fname ... result of the selection of the Dialog to be a variant. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Problem with Dialog
    ... Dim varFiles As Variant ... Text1.AddItem Fname ... result of the selection of the Dialog to be a variant. ...
    (microsoft.public.access.modulesdaovba)
  • RE: Toggle Font Style Macro
    ... Try dim each that way instead of as a variant. ... When evaluating the color index for a "selection", ...
    (microsoft.public.excel.programming)