GreenyMcDuff
Active Member
- Joined
- Sep 20, 2010
- Messages
- 313
Good afternoon everybody,
Essentially the code is used to filter the data I am using by a variable (Rdate). For the filtered Rows a valued of YES must be returned into the visible cells in Column C.
The code I have is below, which is working fine except for one piece.
When the YES is copied (using: xlFillDefault) into Column C it is pasted into every row in the range - not just the visible ones.
I hope someone can help me,
Many thanks
Chris
Essentially the code is used to filter the data I am using by a variable (Rdate). For the filtered Rows a valued of YES must be returned into the visible cells in Column C.
The code I have is below, which is working fine except for one piece.
Dim range_Eval8 As Range
Set range_Eval8 = Range("A1:CA1").Find("Price Change Date (Ss8-FA8)")
Range(range_Eval8, range_Eval8).Select
'Filters data for the date as specified by Rdate
ActiveSheet.Range("$A$1:$BU$14").AutoFilter Field:=range_Eval8.Column, Criteria1:=">=" & Rdate, Operator:=xlAnd
Dim Firstrow_Eval8 As Integer
Dim Lastrow_Eval8 As Integer
ActiveSheet.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible)(2).Select
Selection.End(xlDown).Select
Lastrow_Eval8 = ActiveCell.Row
'Selects first filtered row in Column 3
ActiveSheet.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible)(3).Select
Firstrow_Eval8 = ActiveCell.Row
ActiveCell.FormulaR1C1 = "YES"
Selection.AutoFill Destination:=Range("C" & Firstrow_Eval8 & ":C" & Lastrow_Eval8), Type:=xlFillDefault
ActiveSheet.ShowAllData
When the YES is copied (using: xlFillDefault) into Column C it is pasted into every row in the range - not just the visible ones.
I hope someone can help me,
Many thanks
Chris