Una famiglia di software per fogli di calcolo Microsoft con strumenti per l'analisi, la creazione di grafici e la comunicazione dei dati.
Questo legge i dati filtrati nel Foglio1 in colonna 2 e li mostra in una MsgBox:
Public Sub m()
Dim sh As Worksheet
Dim rng As Range
Dim rCol As Range
Dim c As Range
Dim col As Collection
Dim v As Variant
Dim s As String
Set sh = ThisWorkbook.Worksheets("Foglio1")
With sh
If .AutoFilterMode Then
Set rng = .AutoFilter.Range
Set rCol = rng.Columns(2).SpecialCells(xlCellTypeVisible)
On Error Resume Next
If Err.Number = 1004 Then
Err.Number = 0
Else
Set col = New Collection
For Each c In rCol
col.Add CStr(c.Value), CStr(c.Value)
Next
For Each v In col
s = s & v & ", "
Next
Set col = Nothing
End If
MsgBox Left(s, Len(s) - 2)
End If
End With
Set c = Nothing
Set rCol = Nothing
Set col = Nothing
Set rng = Nothing
Set sh = Nothing
End Sub