Hi
I am trying to working with a table where I want a Macro to i
1. Filter a table on column 2 for all entries for "Yes",
2. Set a range object for the visible cells within column 1.
3. Allow for a specific cell to be amended.within those visible cells
I have the following code that works apart from selecting the right cell in the table for "Set rngSelectedDate = rngDates.Cells(x, 1)" with x being a number that is generated from other code.
If I debug the code to get the cell address of rngSelectedDate for different values of x, it has ignored that I am working with visible cells from the rngDates variable and refers to the actual cell reference for all cells in the table.
Does anyone know how to cell a specific cell within a filtered list of the visible cells?
I am trying to working with a table where I want a Macro to i
1. Filter a table on column 2 for all entries for "Yes",
2. Set a range object for the visible cells within column 1.
3. Allow for a specific cell to be amended.within those visible cells
I have the following code that works apart from selecting the right cell in the table for "Set rngSelectedDate = rngDates.Cells(x, 1)" with x being a number that is generated from other code.
Code:
Dim DataTable As ListObject 'Variable for the table
Dim rngDates As Range 'variable for visible range of cells in column 1
Dim rngSelectedDate As Range 'variable for the required cell within the visible range
Set DataTable = Sheets("Sheet1").ListObjects("DataTable")
DataTable.Range.AutoFilter Field:=2, Criteria1:="Yes"
Set rngDates = DataTable.ListColumns(1).DataBodyRange.SpecialCells(xlCellTypeVisible)
Set rngSelectedDate = rngDates.Cells([B]x[/B], 1)
If I debug the code to get the cell address of rngSelectedDate for different values of x, it has ignored that I am working with visible cells from the rngDates variable and refers to the actual cell reference for all cells in the table.
Does anyone know how to cell a specific cell within a filtered list of the visible cells?