There are 6 columns and I'm using autofilter to filter from 2 columns, however I want to copy and paste another column (after filtering) to a text file.
' Getting the day of the current date
var = Day(Date)
'Autofilter
ActiveSheet.Range("A:F").AutoFilter Field:=3, Criteria1:="=Daily", _
Operator:=xlOr, Criteria2:="=var"
'Get the number of rows in Report column
LastRow = ActiveSheet.UsedRange.Rows.Count
'Loop through the column and paste the report names in the txt file
For iCntr = 2 To LastRow
Write #1 , Range("F" & iCntr)
Next iCntr
Close #1
The loop pastes all the values in COLUMN F. But I want to paste only filtered values.
' Getting the day of the current date
var = Day(Date)
'Autofilter
ActiveSheet.Range("A:F").AutoFilter Field:=3, Criteria1:="=Daily", _
Operator:=xlOr, Criteria2:="=var"
'Get the number of rows in Report column
LastRow = ActiveSheet.UsedRange.Rows.Count
'Loop through the column and paste the report names in the txt file
For iCntr = 2 To LastRow
Write #1 , Range("F" & iCntr)
Next iCntr
Close #1
The loop pastes all the values in COLUMN F. But I want to paste only filtered values.