Select visible cells

In Excel there is a button that can be added to the toolbar called “select visible cells”. This can be useful in many situations, for example in advanced filter when you want to multiple select delete filtered rows without overwriting others that are hidden.

There is an addon that is called “copy visible cells” but that is not the same as select, since it does not allow to edit in place (for example to delete only visible cells, as previously discussed).

So is there any way to select only visible cells ? Or, a simple macro that would allow that? If not, is there a way it can be included in the future release or added to the feature list.

Selecting after apply the filter only selects visible cells, and only those are deleted, same happens with rows/columns-

Please see reply above

I do apologize it seems that you are correct.
The behavior i was described seems due to a strange behavior on using the Advanced filter
After apply advanced filter, select the visible rows and then press “delete”
Remove filter using Data > More filters > Reset filter
You will see than all rows between selected visible rows are not displayed.
You are correct they are not deleted but actually hidden, and can be shown by going to Format > rows > show

This behavior is unexpected, im not sure if it is a bug or not but thats the meaning behind my original post

In case you want the intersection not only for the one mentioned purpose:

Function intersectSelectionWithWindowCellRange(Optional pSelectIt As Boolean)
REM If the selection was made across filtered-out rows,
REM the result will only contain the unfiltered parts.
REM Rows not filtered-out, but hidden, will (according to the way selections
REM are handled generally) NOT be excluded from the intersection! 
If IsMissing(pSelectIt) Then pSelectIt = False
doc0 = ThisComponent
cCtrl0 = doc0.CurrentController
refCellsRA = cCtrl0.ReferredCells.RangeAddress
cSel0 = doc0.CurrentSelection
intersection = cSel0.queryIntersection(refCellsRA)
If pSelectIt Then cCtrl0.select(intersection)
intersectSelectionWithWindowCellRange = intersection
End Function  

Please note:
The SheetCellRanges method queryVisibleCells also excludes rows which are hidden, but not filtered-out.

1 Like