VBA code for knowing the loacation each selected cells in a filtered sheet

michel levy 1 Reputation point
2021-12-05T14:42:16.863+00:00

Hi all,
Can anyone help me please.
when a user selects a range in a filtered sheet and press on a 'do something button'
I want to know the location of only the selected cells within that range

Dim Rng as Range
Dim MM_tbl As ListObject
Set Rng=Selection

for Each Rng in application.selection

 ' is a cell is in a selection mode 
 if MM_tbl.range(rng.row,rng.column).SpecialCells(xlCellTypeVisible)=selected then....

next

Thanks a lot
Michel

Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
3,065 questions
0 comments No comments
{count} votes