Hi Team,
I am very new to VBA so please be gentle.
I am trying to automate a lengthy process that I do everyday and I have recorded a macro to help me do the same.
One part of the process involves filtering a set of names and replacing said names with one common term.
the code - given below - works but it turns every row - not considering its filtered or not - into the term.
Code.
I want to add/use .SpecialCells(xlCellTypeVisible) but dont know where to do the same.
points to note:
1) As its a filtered column there is no guarantee that the first cell after heading would be I2
2) As its filtered there is no guarantee regarding the size of the column. it will be less than the length of column
3) I know usage of AcitveSheet & Cell slows down the macro, but frankly I dont know how to change these
Pls help, thanks
I am very new to VBA so please be gentle.
I am trying to automate a lengthy process that I do everyday and I have recorded a macro to help me do the same.
One part of the process involves filtering a set of names and replacing said names with one common term.
the code - given below - works but it turns every row - not considering its filtered or not - into the term.
Code.
VBA Code:
' "Filing in progress" applied to all relavent cells
Range("I2").Select
ActiveSheet.Range("$A$1:$V$89100").AutoFilter Field:=9, Criteria1:=Array( _
"name 1", "name 2", "name 3", "name 4", "name 5", "name 6"), Operator:=xlFilterValues
Range("H1").Select
ActiveSheet.AutoFilter.Range.Offset(1).SpecialCells(xlCellTypeVisible).Cells(1, 9).Select
ActiveCell.Value = "Filing in Progress"
ActiveCell.AutoFill Range(ActiveCell.Address, Cells(LastRow, ActiveCell.Column))
I want to add/use .SpecialCells(xlCellTypeVisible) but dont know where to do the same.
points to note:
1) As its a filtered column there is no guarantee that the first cell after heading would be I2
2) As its filtered there is no guarantee regarding the size of the column. it will be less than the length of column
3) I know usage of AcitveSheet & Cell slows down the macro, but frankly I dont know how to change these
Pls help, thanks