Tuesday, 17 February 2015

How to Select all the Visible Cells in a Column of Filtered Range and Fill with a Desired Value

Macro to Select all the Visible Cells in a Column of Filtered Range and Fill with a Value
Sub Select_All_Visible_Cells_In_Filtered_Range()
Dim Rng As Variant
Dim WS As WorkSheet
Set WS=ActiveSheet

    WS.Range("A1").Offset(1, 0).Select
    WS.Range(Selection, Selection.End(xlDown)).Select
   Selection.SpecialCells(xlCellTypeVisible).Value = "MyValue"
End Sub

Brief Explanation:
Suppose we have a data , where we have applied the filter on < Column A > then we want to select the all the Visible cells in <Column A> excluding the header , then we have to fill a desired value in the selected Visible Cells.

To do this we can use the above macro.

Sample Filtered Data :
Here the the data is filtered on < Coluumn A >

Out Put data :
Here the Visible Cells in < Column A > has been selected and filled with < desired value >


Thanks,
TAMATAM
 < BI-Reporting Analyst >

1 comment:

Follow Me by Email

ExcelKingdom-Popular Posts

ExcelKingdom-Random Posts