Using specific cell from filtered list

jacko2401

New Member
Joined
Aug 24, 2011
Messages
35
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.

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?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,214,951
Messages
6,122,449
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top